The code calculates properly on MC v8.0 & v8.5, but doesn't on MC v8.8.
Because of this issue, I haven't been able to upgrade latest version of MC for about a year.
I have no idea about this. Would you please help me.
Thank you for reading my poor code and poor english.
Ducktail
Code: Select all
{CountDays}
var:CountDays(1);
if date<>date[1] then
CountDays=CountDays+1;
{High_D / Low_D}
var:MarketOpening(900),MarketClosing(1520),High_D(0),Low_D(0);
If Time=MarketOpening+Barinterval then
begin
High_D=High;
Low_D=Low;
end
else If Time>MarketOpening+Barinterval and time<=MarketClosing then
begin
if High>High_D then High_D=High;
If Low<Low_D then Low_D=Low;
end;
{MarketClosing / Calc ATR}
var:ATR_Length(5),Close_D(0),ATR(0);
Arrays:TrueRangeArray[10](0);
If time=MarketClosing then
begin
Close_D=Close;
TrueRangeArray[1]=Maxlist(High_D-Low_D,High_D-Close_D[1],Close_D[1]-Low_D);
For Value99= 2 to ATR_Length
begin
TrueRangeArray[Value99]=TrueRangeArray[Value99-1][1];
end;
ATR=AverageArray(TrueRangeArray,ATR_Length);
end;
{Print Out}
if CountDays>ATR_Length and time=MarketClosing then
print(date:0:0,",ATR ",ATR:0:0,",TR1 ",TrueRangeArray[1]:0:0,",TR2 ",TrueRangeArray[2]:0:0,",TR3 ",TrueRangeArray[3]:0:0,",TR4 ",TrueRangeArray[4]:0:0,",TR5 ",TrueRangeArray[5]:0:0);