I have tried these variations.:
no barstatus test
barstatus = 1
no test on the ID to put out lots of arrows.
removing the LastBarOnChart_s command.
using LastBarOnChart instead.
Every variation gives the same result. That being, once the next bar is started it removes the arrow(s). I even tried shutting off all other studies to ensure one was not removing them. No luck on that one.
Maybe someone else can give it a shot on the newer versions and post their results. You have to assign the study to subchart #2 and the self commands are for subchart #2. The print statements may help you.
In the end I have had to put the two arrows I need out manually and ensure that my text/arrow/line cleanup study does not remove these two arrows.
Code: Select all
variables:
arwNewID1(0),
arwNewID2(0);
if LastBarOnChart_s then
Begin
if barstatus = 2 and arwNewID1 = 0 then
begin
arwNewID1 = arw_new_self_s(date,Time_s,95,true);
value9 = arw_setcolor(arwNewID1,tool_Yellow);
value9 = arw_setstyle(arwNewID1,0);
value9 = arw_setsize(arwNewID1,5);
arwNewID2 = arw_new_self_s(date,Time_s,5,false);
value9 = arw_setcolor(arwNewID2,tool_Yellow);
value9 = arw_setstyle(arwNewID2,0);
value9 = arw_setsize(arwNewID2,5);
Print( File("C:\A_MyAR_Arrow_10Sec.txt"),
" ArwNewID1 ", " " ,
ArwNewID1 , " " ,
" ArwNewID2 ", " " ,
ArwNewID2 , " " ,
" ");
End;
End;