هذا هو الراسم--يحفظ تحت خبير---موازنة الزوايا لم استخدم tan -- بل 1 وحدة ضد 2 وحدة مثلا
لو استخدمنا tan تصبح ادق
ارجو ان يكون مفهوم لك لكود--كل الاساسيات فيه بما في ذلك الزوايا----
وثق تمام الثقة الكمبيوتر يرسم افضل من الروقة والقلم واادق -- ولكن لابد نفهم كيف--خلنا نرككز على هذه النقطة ونزيل اي افكار اخرى
كود PHP:
int bar=Bars;
void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
{
if(id==CHARTEVENT_CLICK)
{
int x =(int)lparam;
int y =(int)dparam;
datetime dt =0;
double price =0;
int window=0;
if(ChartXYToTimePrice(0,x,y,window,dt,price))
{
bar=iBarShift(NULL,0,dt); if(bar<1) bar=1;
int AB=10;
int XT[]={1,2,3,4,8,16,32,64};
int t=ArraySize(XT);
string XY[];
ArrayResize(XY,t);
string XD[];
ArrayResize(XD,t);
if(High[bar]>=High[bar+1] && High[bar]>=High[bar-1])
{
double V1=High[bar];
for(int i=0;i<t;i++)
{
XY[i]=DoubleToString(int(100*180.00/M_PI*MathArctan(1.0*XT[i]))/100.0,2);
XD[i]=DoubleToString(int(100*180.00/M_PI*MathArctan(1.0/XT[i]))/100.0,2);
double V2=High[bar]-10*XT[i]*AB*_Point;
double V3=High[bar]-10*AB*_Point/XT[i];
ObjectDelete("hDegree: -"+XY[i]);
ObjectCreate("hDegree: -"+XY[i],OBJ_TREND,0,iTime(NULL,0,bar),V1,iTime(NULL,0,bar-AB),V2);
ObjectSet( "hDegree: -"+XY[i],OBJPROP_COLOR,clrWhite);
ObjectSet( "hDegree: -"+XY[i],OBJPROP_WIDTH,1);
ObjectSet( "hDegree: -"+XY[i],OBJPROP_STYLE,STYLE_DOT);
ObjectDelete("hDegree: -"+XD[i]);
ObjectCreate("hDegree: -"+XD[i],OBJ_TREND,0,iTime(NULL,0,bar),V1,iTime(NULL,0,bar-AB),V3);
ObjectSet( "hDegree: -"+XD[i],OBJPROP_COLOR,clrAqua);
ObjectSet( "hDegree: -"+XD[i],OBJPROP_WIDTH,1);
ObjectSet( "hDegree: -"+XD[i],OBJPROP_STYLE,STYLE_DOT);
}
}
else if(Low[bar]<=Low[bar+1] && Low[bar]<=Low[bar-1])
{
V1=Low[bar];
for(i=0;i<t;i++)
{
V2=Low[bar]+10*XT[i]*AB*_Point;
V3=Low[bar]+10*AB*_Point/XT[i];
ObjectDelete("lDegree: +"+XY[i]);
ObjectCreate("lDegree: +"+XY[i],OBJ_TREND,0,iTime(NULL,0,bar),V1,iTime(NULL,0,bar-AB),V2);
ObjectSet( "lDegree: +"+XY[i],OBJPROP_COLOR,clrLime);
ObjectSet( "lDegree: +"+XY[i],OBJPROP_WIDTH,1);
ObjectSet( "lDegree: +"+XY[i],OBJPROP_STYLE,STYLE_DOT);
ObjectDelete("lDegree: +"+XD[i]);
ObjectCreate("lDegree: +"+XD[i],OBJ_TREND,0,iTime(NULL,0,bar),V1,iTime(NULL,0,bar-AB),V3);
ObjectSet( "lDegree: +"+XD[i],OBJPROP_COLOR,clrYellow);
ObjectSet( "lDegree: +"+XD[i],OBJPROP_WIDTH,1);
ObjectSet( "lDegree: +"+XD[i],OBJPROP_STYLE,STYLE_DOT);
}
}
}
for(i=t+1;i<=106;i++)
{
ObjectDelete("hDegree: -"+XD[i]); ObjectDelete("lDegree: +"+XD[i]);
ObjectDelete("lDegree: +"+XY[i]); ObjectDelete("hDegree: -"+XY[i]);
}
}
}
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- create timer
EventSetTimer(1);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//--- destroy timer
EventKillTimer();
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
//| Timer function |
//+------------------------------------------------------------------+
void OnTimer()
{
//---
}
//+------------------------------------------------------------------+
//| ChartEvent function |