The objective is to have intraday a vertical trendline with the daily range. I tried 2 options but only the second one worked.
First Option: Code analyses if this bar is a new day. If so, it would delete the TL. This is not working.
Code: Select all
if dayofmonth(date)<>dayofmonth(date)[1] then begin
TL_delete(Value1);
end;
value1=TL_new(CurrentDate,2300,HighD(0),CurrentDate,2300,LowD(0));
Apparently MC is drawing a TL from the lowest value ever to the highest value ever. I suspect that it is drawing the daily TLs since the beginning of the quotes, without deleting any of them (which means they are all overlapping). I was trying to understand why this first option is not working.
Second Option: The simple approach, deleting the TL every bar and draw it again.
Code: Select all
TL_delete(Value1);
value1=TL_new(CurrentDate,2300,HighD(0),CurrentDate,2300,LowD(0));
This works well.
Another question: is it possible to have the TL identified with something other than value1 ? I would prefer to have DailyRangeTL for example.