مجموع ارقام التي تساوي 13 لم تظهر؟اقتباس:
ومع ذلك هذا الكود . .
كود:color clr_333=C'0,111,000';
color clr_666=C'111,111,000';
color clr_999=C'111,0,000';
color clr_vl=C'255,0,255';
int cell_width=100;
int TOTAL_DAYS=300;
double d;
int dig;
int n11=11;
int n13=13;
int OnInit()
{
d=1000*_Point;
dig=Digits-Digits%2-2;
if(Digits%2==0)d=d/10;
if(StringSubstr(Symbol(),0,6)=="XAUUSD")
{
///ضع هنا قيمة دي ودق
}
EventSetTimer(1);
return(INIT_SUCCEEDED);
}
void OnDeinit(const int reason)
{
EventKillTimer();
ObjectsDeleteAll(0);
}
void OnTimer()
{
draw_vlines();
button_panel();
}
int font=7;
int UPPER_START_X=200;
void button_panel()
{
int dy=22;
int y=-1;int dx=cell_width;
int x=UPPER_START_X;
color clr=C'88,88,88';
Create_Button("N11",n11,x,y,dx,dy,font,CN11,clrBlack,clrNONE,"");
x=x+dx; clr=C'88,88,88';
Create_Button("N13",n13,x,y,dx,dy,font,CN13,clrWhite,clrNONE,"");
}
void Create_Button(string name,string text,int X,int Y,int W,int H,int width,color BackColor,color TextColor,color borderColor,string TOOL)
{
ObjectCreate(0,name,OBJ_BUTTON,0,0,0);
ObjectSetInteger(0,name,OBJPROP_XSIZE,W);
ObjectSetInteger(0,name,OBJPROP_YSIZE,H);
ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
ObjectSetInteger(0,name,OBJPROP_XDISTANCE,X);
ObjectSetInteger(0,name,OBJPROP_YDISTANCE,Y);
ObjectSetInteger(0,name,OBJPROP_FONTSIZE,width);
ObjectSetInteger(0,name,OBJPROP_HIDDEN,true);
ObjectSetString(0,name,OBJPROP_TOOLTIP,TOOL);
ObjectSetInteger(0,name,OBJPROP_BORDER_TYPE,BORDER_SUNKEN);
ObjectSetInteger(0,name,OBJPROP_BACK,FALSE);
ObjectSetInteger(0,name,OBJPROP_SELECTABLE,FALSE);
ObjectSetInteger(0,name,OBJPROP_SELECTED,FALSE);
ObjectSetInteger(0,name,OBJPROP_HIDDEN,FALSE);
ObjectSetInteger(0,name,OBJPROP_ZORDER,1);
ObjectSetInteger(0,name,OBJPROP_BGCOLOR,BackColor);
ObjectSetInteger(0,name,OBJPROP_ALIGN,ALIGN_CENTER);
ObjectSetInteger(0,name,OBJPROP_BORDER_COLOR,borderColor);
ObjectSetInteger(0,name,OBJPROP_COLOR,TextColor);
ObjectSetString(0,name,OBJPROP_FONT,0);
ObjectSetString(0,name,OBJPROP_TEXT,text);
ObjectSetInteger(0,name,OBJPROP_STATE,FALSE);
}
color CN11=C'225,155,255';
color CN13=C'255,155,0';
void draw_vlines()
{
double point=_Point;if(point<DBL_EPSILON)point=1;
datetime time00=iTime(Symbol(),PERIOD_D1,0);
double price00=double(DoubleToString(iOpen(Symbol(),PERIOD_D1,0),dig));
for(int i=0;i<555;i++)
{
string ii=StringSubstr("00"+i,StringLen("00"+i)-4,4);
double price11=price00+i*100*_Point;
double price13=price00-i*100*_Point;
string price11s=DoubleToString(price11/point,0);
string price13s=DoubleToString(price13/point,0);
int sum0=0;
int sum1=0;
for(int k=0;k<StringLen(price11s);k++)
{
sum0=sum0+int(StringSubstr(price11s,k,1));
}
for(k=0;k<StringLen(price13s);k++)
{
sum1=sum1+int(StringSubstr(price13s,k,1));
}
if(sum0==n11)
{
string name=price11s+ii;
ObjectDelete(name);
ObjectCreate(0,name,OBJ_HLINE,0,0,price11);
ObjectSetInteger(0,name,OBJPROP_COLOR,CN11);
ObjectSetInteger(0,name,OBJPROP_RAY_RIGHT,FALSE);
ObjectSetInteger(0,name,OBJPROP_STYLE,2);
}
else if(sum1==n11)
{
name=price13+ii;
ObjectDelete(name);
ObjectCreate(0,name,OBJ_HLINE,0,0,price13);
ObjectSetInteger(0,name,OBJPROP_COLOR,CN11);
ObjectSetInteger(0,name,OBJPROP_RAY_RIGHT,FALSE);
ObjectSetInteger(0,name,OBJPROP_STYLE,2);
}
else if(sum0==n13)
{
name=price11s+ii;
ObjectDelete(name);
ObjectCreate(0,name,OBJ_HLINE,0,0,price11);
ObjectSetInteger(0,name,OBJPROP_COLOR,CN13);
ObjectSetInteger(0,name,OBJPROP_RAY_RIGHT,FALSE);
ObjectSetInteger(0,name,OBJPROP_STYLE,2);
}
else if(sum1==n13)
{
name=price13+ii;
ObjectDelete(name);
ObjectCreate(0,name,OBJ_HLINE,0,0,price13);
ObjectSetInteger(0,name,OBJPROP_COLOR,CN13);
ObjectSetInteger(0,name,OBJPROP_RAY_RIGHT,FALSE);
ObjectSetInteger(0,name,OBJPROP_STYLE,2);
}
}
}
فقط ارقام التي مجموعها 11

