assign value to arrows

Questions about MultiCharts and user contributed studies.
jsramek
Posts: 7
Joined: 03 Jan 2012
Has thanked: 2 times

assign value to arrows

Postby jsramek » 17 Jan 2012

I have created a indicator that will draw arrows up for bullish down for bearish. My problem is though my conditions can generate several of the same arrow consecutively so the signals might look something like buy buy buy sell sell buy. what i want is for the arrows to be buy, sell , buy sell etc.

I did this in NT sucessfully and thought i had the programming correct for multicharts also but doesnt seem to be working. Let me know if anyone has any insight on this

I did this in NT by assigning values to the arrows

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: assign value to arrows

Postby furytrader » 17 Jan 2012

I would keep a running toggle variable that tells you whether the most recent arrow was a buy or a sell arrow, and then code the setup for a buy signal to verify (using the toggle) that the most recent arrow was a sell (and vice versa). Once the buy signal arrow is posted, you then switch the toggle variable to say that the most recent arrow was a buy arrow, etc.

If you're comfortable, you can post a snippet of the code here and I can try to be more specific.

jsramek
Posts: 7
Joined: 03 Jan 2012
Has thanked: 2 times

Re: assign value to arrows

Postby jsramek » 17 Jan 2012

furytrader thanks for your help the toggle variable works, it ended up being that I only needed 1 variable for multicharts where i had 2 in NT.

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: assign value to arrows

Postby bowlesj3 » 18 Jan 2012

If you are new to MC and are new to the reserve word "intrabarpersist" (and not using it) that may cause problems. Also line/arrows and text do not stay on the chart until the end of the bar when barstatus=2. They get drawn then deleted then drawn then deleted then drawn then deleted over and over on every tick until barstatus=2. If you need more info the thread below explains it. If I know how many of these drawings I am going to need I create them all on currentbar=1 (hiding them from view) then move them into place when I need them seen. this saves all that deleting which occurs between bar completions. When I want them removed I just hide them again. Doing this also reduces the risks when you have 2 or more studies adding new arrows and deleting them. It is tricky if you actually want to add an arrow mid bar and maybe delete it somewhere later. In this case you do not want to use Intrabarpersist. Again the thread explains it all. No doubt about it, not knowing what is in this thread will drive you crazy until you do. There is similar info in the tips, tricks and traps thread which is part of FAQs.

viewtopic.php?f=5&t=6871&hilit=understa ... barpersist

viewtopic.php?f=16&t=7665

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 23 times

Re: assign value to arrows

Postby Katrin Yanenko » 25 Jan 2012

I have created a indicator that will draw arrows up for bullish down for bearish. My problem is though my conditions can generate several of the same arrow consecutively so the signals might look something like buy buy buy sell sell buy. what i want is for the arrows to be buy, sell , buy sell etc.

I did this in NT sucessfully and thought i had the programming correct for multicharts also but doesnt seem to be working. Let me know if anyone has any insight on this

I did this in NT by assigning values to the arrows
Hi,


Please send us your studies and screenshots that can demonstrate this issue.
We need this information in order we could investigate it on our end.
It would be very helpful for us if you also could send us the image of how it should be from your point of view.

Best Regards,
Katrin Yanenko


Return to “MultiCharts”