This code..
Code: Select all
variables:
trendLine1(0);
once begin
trendLine1 = TL_New(0,0,0,0,0,0);
cleardebug;
end;
if (LastBarOnChart_s = True) then begin
Print("Id of 'trendLine1'? ", trendLine1);
value1 = TL_SetBegin(trendLine1, Date, 1100, 2422);
Print("Error message of SetBegin? ", value1);
value2 = TL_SetEnd(trendLine1, Date, 1100, 2432);
Print("Error message of SetEnd? ", value2);
end;
Code: Select all
Id of 'trendLine1'? 2.00
Error message of SetBegin? 0.00
Error message of SetEnd? 0.00
But removing the LastBarOnChart_s segment, with otherwise the same settings and code (MC 7.4 Build 4906):
Code: Select all
variables:
trendLine1(0);
once begin
trendLine1 = TL_New(0,0,0,0,0,0);
cleardebug;
end;
Print("Id of 'trendLine1'? ", trendLine1);
value1 = TL_SetBegin(trendLine1, Date, 1100, 2422);
Print("Error message of SetBegin? ", value1);
value2 = TL_SetEnd(trendLine1, Date, 1100, 2432);
Print("Error message of SetEnd? ", value2);
Code: Select all
Id of 'trendLine1'? 2.00
Error message of SetBegin? 0.00
Error message of SetEnd? 0.00
Id of 'trendLine1'? 2.00
Error message of SetBegin? 0.00
Error message of SetEnd? 0.00
Id of 'trendLine1'? 2.00
Error message of SetBegin? 0.00
Error message of SetEnd? 0.00
Id of 'trendLine1'? 2.00
Error message of SetBegin? 0.00
Error message of SetEnd? 0.00
..and so on
In other words, TL_SetEnd & TL_SetBegin doesn't seems to work with LastBarOnChart_s? Which is a shame, since it's needless computer intensive to move the vertical line every bar if it's only needed on the last bar (especially if one aims to make multiple vertical lines).
Or am I doing something wrong?