I have a coding problem that i need help with. I have tried so many things and tried to read in the manual but haven’t found the answer… Im want to know how you write the code when you want to sell after a couple of days has passed. (Maybe that
dosen´t work with PRT Backtestning???)
Can you write something like this and put the correct function in the text?
If you are executing this strategy on a daily timeframe, then you can play with barindex to test the difference between the current bar number and the one of when the trade was launched.
So if you want to sell your long trade when it’s 3 days old, you can code it like this:
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