For example every 2 hours my indicator prints the average price of the previous 2 hour period and my entry 1 is set to trigger only when price closes X ticks under the chosen line:
[SIZE=12px]if (Profit==1) line=AV().Av1[0]; else if (Profit==2) line=AV().Av2[0]; else if (Profit==3) line=AV().Av3[0]; else if (Profit==4) line=AV().Av4[0]; else if (Profit==5) line=AV().Av5[0]; if (Position.MarketPosition==MarketPosition.Flat && BarsInProgress==0) { //ENTRY 1 if (Close[0]+MinTickAway*TickSize<line) { //Print(Time[0]+" - "+line); prof=line; EnterLong(Lot1,"Entry1"); SetStopLoss("Entry1",CalculationMode.Ticks,SL,true ); SetProfitTarget("Entry1",CalculationMode.Price,line,true);[/SIZE]
Does anyone know why the live conditions might distort the codes functionality?
Please see attached photo to better understand the desired functionality in strategy analyzer and what occurred today. (Green Line is AV1, which is the desired profit target)
Comment