Strategy is closing based on wrong timeframe

Forums ProRealTime English forum ProOrder support Strategy is closing based on wrong timeframe

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

    Hi,

    I’m trying to get the below strategy to work but its closing on the wrong timeframe.

    Sorry, but I can’t see an ‘insert PRT code’ button on the toolbar on this browser.

    For example the backtest shows trades opening when the 1minute MA50 is crossed when want I’m hoping for is for a trade to open within a minute or so of the 1hr MA50 being crossed. The same issue is happening on trade exits.  I’m hoping someone can easily spot an obvious error I’ve made! Thanks

     

     

     

     

     

    #211066

    Hi there,

     

     

    1. Buying Long goes by Buy … at Market – Selling long goes by Sell … at Market.
    2. Even if you’d have that right, the two commands as how you put them, may cancel out each other because both conditions may be true at the same time and there is no prevention against that; for that, the second condition can contain an And OnMarket.

     

     

    1 user thanked author for this post.
    #211067
    JS

    Hi @Jaanboy321

    I tried your code and the positions are opened and closed according to the correct time frame…

    1 user thanked author for this post.
    #211154

    within a minute or so of the 1hr MA50 being crossed.

    At Line 14, instead of …

    Try

     

     

     

     

    1 user thanked author for this post.
    #211184

    Thanks everyone, much appreciated. Currently utilising this version to go long USDJPY (setting closing conditions according to the market) . Its not perfect but seems to do what I need and will experiment with your suggestions as required.

    1 user thanked author for this post.
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