i am not sure your specific situation.just according to my experience, that solution could be either only use if clause for the new bars ( one single bar has too many ticks meeting that condition) or use NormalizeDouble() to control the precision to filter out some chaos.
good luck.
cijs, thank you for answer, but the problem is that I am using daily chart for testing and price croses upper Bollinger band only once
cijs, thank you for answer, but the problem is that I am using daily chart for testing and price croses upper Bollinger band only once
Hi Kovas,
I hear what you're saying about the price only crossing once, but I doubt that this is actually what happens. Each time a new price tick comes in your code will execute. So any time this condition is met you will get a new alert. Unless the trend is very strong price hardly ever moves smoothly without at least small retracements. So it is more likely that price hovers around your boundary point before passing it - thereby creating several alerts.
To keep this from happening you would need to insert a flag that is set after the first alert and is not cleared until something else happens - like price moving a certain ammount below the band.
- Tovan
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, why I get mass of ask prices if I just need one price when it cross upper iBand.
Does an error: TestGenerator: unmatched data error (volume limit 45160 at 2009.03.26 00:00 exceeded), has any impact?
thanks