،،،مثال علي المطلوب،،،
كود:
int start() {
int x,y;
int xdist = 250;
int ydist = 100;
color col;
string diff;
for(x=0;x<=2;x++)
for(y=0;y<=7;y++) {
if (MarketInfo(symb[y], MODE_POINT) == 0.00001) pointvalue = 0.0001;
else if (MarketInfo(symb[y], MODE_POINT) == 0.001) pointvalue = 0.01;
else pointvalue = MarketInfo(symb[y], MODE_POINT);
double diffsma7_20H1 = iMA(symb[y],PERIOD_H1,7,0,MODE_LWMA,PRICE_CLOSE,0)- iMA(symb[y],PERIOD_H1,20,0,MODE_LWMA,PRICE_CLOSE,0);
double diffsma7_20H4 = iMA(symb[y],PERIOD_H4,7,0,MODE_LWMA,PRICE_CLOSE,0)- iMA(symb[y],PERIOD_H4,20,0,MODE_LWMA,PRICE_CLOSE,0);
double diffsma7_20D1 = iMA(symb[y],PERIOD_D1,7,0,MODE_LWMA,PRICE_CLOSE,0)- iMA(symb[y],PERIOD_D1,20,0,MODE_LWMA,PRICE_CLOSE,0);
string diffH1 = DoubleToStr((diffsma7_20H1/pointvalue),1);
string diffH4 = DoubleToStr((diffsma7_20H4/pointvalue),1);
string diffD1 = DoubleToStr((diffsma7_20D1/pointvalue),1);
switch(x) {
case 0: diff = diffH1;
if(diffsma7_20H1 < 0)col = Red;
else col=Green; break;
case 1: diff = diffH4;
xdist+= 250;
if(diffsma7_20H4 < 0)col = Red;
else col=Green; break;
case 2: diff = diffD1;
xdist+= 250;
if(diffsma7_20D1 < 0)col = Red; else col=Green; break; }
ObjectCreate("diff"+x+y,OBJ_LABEL,0,0,0,0);
ObjectSet("diff"+x+y, OBJPROP_XDISTANCE,xdist);
ObjectSet("diff"+x+y, OBJPROP_YDISTANCE,ydist);
ObjectSetText("diff"+x+y,diff,10, "Times New Roman", col);
ydist+= 65; }
return(0); }