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
assign value to arrows
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
Re: assign value to arrows
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.
If you're comfortable, you can post a snippet of the code here and I can try to be more specific.
Re: assign value to arrows
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.
Re: assign value to arrows
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
viewtopic.php?f=5&t=6871&hilit=understa ... barpersist
viewtopic.php?f=16&t=7665
- Katrin Yanenko
- Posts: 55
- Joined: 28 Nov 2011
- Has thanked: 18 times
- Been thanked: 23 times
Re: assign value to arrows
Hi,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
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