Why did my strategy open a position?

Forums ProRealTime English forum ProOrder support Why did my strategy open a position?

Viewing 5 posts - 1 through 5 (of 5 total)
  • #154380

    Hi

    My code below seemed to work previously so I cannot understand why it doesn’t work anymore. Has something changed in PRT or is there a coding error?

    Backtesting based on Daily DJI. I have also attached screenshots of the trade day, trigger day and trigger day -1 values of the indicators to assist you. Why did backtesting open a new long position on 16th Dec 2020?

    The issue seems to be specifically in relation to the code in lines 33 to 45. In this particular example (see screenshots), x[1] > y[1] AND x[1] > 70 AND x > y are all true so a = 1. If a = 1, then as per line 49, it should not enter into a long position on 16th Dec 2020.

    x = AroonUp[10]

    y = AroonDown[10]

    Please advise. Let me know if you need any further information.

    Thanks

    Sachin

     

    #154815

    If you append this code to your strategy:

    you will be able to see that on Dec. 15th 2020 conditions at line 49 were met when the daily candle closed, so it immediately entered a trade (signaled with an arrow on Dec. 16th).

    1 user thanked author for this post.
    #154854

    sulimaster – Please follow the forum rules and give any future topics a meaningful title otherwise we will end up with a forum full of ‘Code error’ topics. I have changed your topic title.

    #154899

    Thanks Roberto

    Another thing I’m struggling with – in the live market (trading with IG), using the same strategy, why was a long trade opened on 18th Dec 2020 instead of 16th December 2020 as per the tick by tick back test (see attached)?

    #154937

    Mine was opened on Dec. 16th.

     

Viewing 5 posts - 1 through 5 (of 5 total)

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