arrow in volume bars charts

Questions about MultiCharts and user contributed studies.
thariman
Posts: 18
Joined: 21 Jul 2006

arrow in volume bars charts

Postby thariman » 07 Jan 2009

Hi
I have the following code:
Basically it is going to mark each swing high.
This code seems to work fine in 5 minute bar chart.
But in a volume chart some work some don't.

Is my logic wrong or arw_new is not accurate enough to put the arrow in volume bars ?

Code: Select all

variables: highUp(FALSE);

print(currentbar, " H[1] ", High[1], " H ", High, " hgUp ", highUp, " D ", Date, " T ", Time );
if ( High[1] < High and not highUp ) then
begin
highUp = TRUE;
end;

if ( High[1] > High and highUp ) then
begin
highUp = FALSE;
Value1 = Arw_new( Date[1], Time[1], High[1], True );
Value2 = Arw_setstyle( Value1, 0 );
print ( currentbar, " Arrow D[1] ", Date[1], " T[1] ", Time[1], " H[1] ", High[1] );
end;


I attached the screenshot the one with ticker red arrow I think is wrong.
Looking at the output log the High value pointing to the correct bar.

Thank you

Tony
Attachments
SwingHigh.png
(32.72 KiB) Downloaded 334 times
Last edited by thariman on 08 Jan 2009, edited 1 time in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 07 Jan 2009

because when you are using volume bars,
you have to use the "second" keywords.

look up the following words in the PowerEditor dictionary.

arw_new_s()
time_s()



p.s. on the date, you don't need the [1] reference.

thariman
Posts: 18
Joined: 21 Jul 2006

Postby thariman » 07 Jan 2009

Got it. Less error but not 100% perfect. In a 343 is fine but going lower to 49 there is still a few wrong arrow. Thanks TJ

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 07 Jan 2009

Got it. Less error but not 100% perfect. In a 343 is fine but going lower to 49 there is still a few wrong arrow. Thanks TJ
if there is a tick with more than 49 contracts, the volume will spill over and span across multiple bar increments. In such a case, the arrow will rests on the bar that triggered the arrow. (i.e. the first bar)

thariman
Posts: 18
Joined: 21 Jul 2006

Postby thariman » 08 Jan 2009

Wish MC have arw_new and text_new base on barnumber to be more accurate.
Very useful for those who use volume bar for their charting.


Return to “MultiCharts”