|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
how to
im litle stucked i want to use just opened candle and not previus i tryed to change things in the code but im getting many errors this is a peace of the code
for (shift=CountDays-1;shift>=0;shift--) { time1=iTime(NULL,PERIOD_D1,shift); i=shift-1; if (i<0) time2=Time[0]; else time2=iTime(NULL,PERIOD_D1,i)-Period()*60; high = iHigh(NULL,PERIOD_D1,shift+1); low = iLow(NULL,PERIOD_D1,shift+1); open = iOpen(NULL,PERIOD_D1,shift+1); close = iClose(NULL,PERIOD_D1,shift+1); please give a hint sailor the bad code reader |
|
|||
|
here it is im not done yet with modifying
------------------------------------------------------------------------ //+------------------------------------------------------------------+ //| AllPivots_v1.mq4 | //| Copyright © 2006, Forex-TSD.com | //| Written by IgorAD,igorad2003@yahoo.co.uk | //| http://finance.groups.yahoo.com/group/TrendLaboratory | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, Forex-TSD.com " #property link "http://www.forex-tsd.com/" #property indicator_chart_window extern int CountDays=10; extern bool Plot_pivots=true; extern bool Plot_middle=false; extern bool Plot_camarilla=false; datetime time1; datetime time2; double open,close,high,low; double P,R1,R2,R3,S1,S2,S3,M0,M1,M2,M3,M4,M5; double H1,H2,H3,H4,L1,L2,L3,L4,Range; double pstyle, mstyle,cstyle; int shift, num; void ObjDel() { for (;num<=CountDays;num++) { ObjectDelete("PP["+num+"]"); ObjectDelete("R1["+num+"]"); ObjectDelete("R2["+num+"]"); ObjectDelete("R3["+num+"]"); ObjectDelete("S1["+num+"]"); ObjectDelete("S2["+num+"]"); ObjectDelete("S3["+num+"]"); } } void PlotLine(string name,double value,double line_color,double style) { ObjectCreate(name,OBJ_TREND,0,time1,value,time2,va lue); ObjectSet(name, OBJPROP_WIDTH, 1); ObjectSet(name, OBJPROP_STYLE, style); ObjectSet(name, OBJPROP_RAY, false); ObjectSet(name, OBJPROP_BACK, true); ObjectSet(name, OBJPROP_COLOR, line_color); } int init() { return(0); } int deinit() { ObjDel(); Comment(""); return(0); } int start() { int i; ObjDel(); num=0; for (shift=CountDays-1;shift>=0;shift--) { time1=iTime(NULL,PERIOD_D1,shift); i=shift-1; if (i<0) time2=Time[0]; else time2=iTime(NULL,PERIOD_D1,i)-Period()*60; high = iHigh(NULL,PERIOD_D1,shift+1); low = iLow(NULL,PERIOD_D1,shift+1); open = iOpen(NULL,PERIOD_D1,shift+1); close = iClose(NULL,PERIOD_D1,shift+1); P = open; R1 = P+(55*Point); R2 = P+(89*Point); R3 = P+(144*Point); S1 = P-(55*Point); S2 = P-(89*Point); S3 = P-(144*Point); time2=time1+PERIOD_D1*60; pstyle=0; mstyle=3; cstyle=1; num=shift; PlotLine("PP["+num+"]",P,Aqua,pstyle); if(Plot_pivots) { PlotLine("R1["+num+"]",R1,Red,pstyle); PlotLine("R2["+num+"]",R2,Orange,pstyle); PlotLine("R3["+num+"]",R3,Gold,pstyle); PlotLine("S1["+num+"]",S1,MediumSeaGreen,pstyle); PlotLine("S2["+num+"]",S2,Lime,pstyle); PlotLine("S3["+num+"]",S3,GreenYellow,pstyle); } } return(0); } //+------------------------------------------------------------------+ sailor |
![]() |
| Thread Tools | |
| Display Modes | |
|
|