I have a quick question for you. I just built a simple Trading System. I would like to put in code something like “when this condition happen buy two (or three) bars after the signal happened”.
nextbaropen is depreciated, it is not used anymore in the PRT language.
You can save the barindex when your signal occur and then compare its value with the current barindex one. Of course your ‘golong’ signal should occur only once in the past, otherwise the ‘signalbar’ variable would be constantly renewed with the current barindex.
1
2
3
4
5
6
7
8
9
xxx=golong
ifxxxthen
signalbar=barindex
endif
ifbarindex-xxx=2then
buy1lotatmarket
endif
Please take the time to understand before asking your next question 🙂
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue