arw_new_self_s(date,Time_s,95,true); not working

Questions about MultiCharts and user contributed studies.
bowlesj3
Posts: 2026
Joined: 21 Jul 2007
Has thanked: 174 times
Been thanked: 405 times

arw_new_self_s(date,Time_s,95,true); not working

Postby bowlesj3 » 12 Feb 2009

I am trying to put two arrows out on the 10 second bars near the very end of the chart (a subchart #2 chart) and it does not seem to work very well. It puts them out for one bar then once the next bar is started it removes them and the study can not put out the arrows again (a one trick pony it seems). They will not hold even if you put them out with barstatus=2. Normally this works on the main chart commands for the arw_new. The code below is an extract from my study for anyone wanting to give this a try.

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;



Return to “MultiCharts”