Coding issue in ProBuilder Backtest

Forums ProRealTime English forum ProBuilder support Coding issue in ProBuilder Backtest

Viewing 2 posts - 1 through 2 (of 2 total)
  • #10446

    Hello!

    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 x1 then
    sell 1 contract at market
    endif

    Sincerly

    Christian Nordén

    #10454

    Hello Christian,

    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:

     

    1 user thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login