I would prefer to not wait for the next bar when a chart is loaded is there another way to if (bar before !historical or the last historical bar?)
p.s. it ran fine without it in NT7
p.s.s. CalcTakeProfit is a method included as a double just before properties section to calculate takeprofit based on pivot positions.
if (!Historical)
{
if (SMA(50)[0] > SMA(200)[0])
Plot0.Set((CurrentBar - myTemp)/6);
else
Plot0.Set(-1 * ((CurrentBar - myTemp)/6));
myTempstring = "+ " + Math.Round((CalcTakeProfit(1,true) - Close[0])/(TickSize),0).ToString() +
" | " + Math.Round((CalcTakeProfit(1,false) - Close[0])/(TickSize),0).ToString();
DrawTextFixed("MyFixedStringTop", myTempstring, TextPosition.TopRight);
}

Comment