signal arrows above each bar as long as the condition is true  [SOLVED]

Questions about MultiCharts and user contributed studies.
czaussie1029
Posts: 7
Joined: 20 Nov 2023

signal arrows above each bar as long as the condition is true

Postby czaussie1029 » 13 Dec 2023

Hello all,

can you please point me in the right direction of how to display arrow above the bar, above EVERY bar, as long as the condition is valid?
My code below works well, but it only shows the arrow on the first bar when the condition becomes true. I would like it to be repeated until the condition turns false.

What needs to be changed/added?

Thank you in advance.

Code: Select all

condition1 = var0 crosses over var1; condition2 = var0 crosses under var1; if condition1 then begin Arw_SetStyle(newArrowUp, 2); Arw_SetColor(newArrowUp, Green); Arw_SetSize(newArrowUp, 7); newArrowUp= Arw_SetLocation_BN(newArrowUp, currentbar, High); newArrowUp= Arw_New_BN(currentbar,High,False); end; if condition2 then begin Arw_SetStyle(newArrowDown, 2); Arw_SetColor(newArrowDown, Red); Arw_SetSize(newArrowDown, 7); newArrowDown= Arw_SetLocation_BN(newArrowDown, currentbar, High); newArrowDown= Arw_New_BN(currentbar,High,True); end;

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

Re: signal arrows above each bar as long as the condition is true

Postby TJ » 13 Dec 2023

Try this?

Code: Select all

condition1 = var0 > var1; condition2 = var0 < var1;

ps. bear in mind you will be drawing A LOT of arrow objects. It will slow down your computer.

czaussie1029
Posts: 7
Joined: 20 Nov 2023

Re: signal arrows above each bar as long as the condition is true  [SOLVED]

Postby czaussie1029 » 13 Dec 2023

Try this?

Code: Select all

condition1 = var0 > var1; condition2 = var0 < var1;

ps. bear in mind you will be drawing A LOT of arrow objects. It will slow down your computer.
Thanks for simple, but effective solution. I suppose I can add some code that will all old arrows except for the last 50 for example.


Return to “MultiCharts”