wang:
Let say, now there is an MACD crossover, how to record its time (the closing time of that particular bar), and later when i want to open a position, i want to know how far the current time is from that MACD crossover time? I want to open a trade only if the current time is less than 10 bars away from that MACD crossover. How to program it?
Many thanks to all the high hands for your kind help!
At the moment of crossover you save the time using Time[0] or TimeCurrent() and later you will need to use iBarShift() to count how many bars have passed since the crossover.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Let say, now there is an MACD crossover, how to record its time (the closing time of that particular bar), and later when i want to open a position, i want to know how far the current time is from that MACD crossover time? I want to open a trade only if the current time is less than 10 bars away from that MACD crossover. How to program it?
Many thanks to all the high hands for your kind help!