Range breakout strategy

Forums ProRealTime English forum ProOrder support Range breakout strategy

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

    Hi there, I am trying to code a strategy that involves collecting the highest high price and the lowest low of a particular time range in the morning. After this time, there is another period of 2 hour where if the price closes above this range, a long is opened with a stop loss at the lowest low point; and vice versa if close is below the lowest low.

    Additionally, if the trade is stopped out; then an opposing trade is opened in the opposite direction, with the stop set again at the opposing end of the range.

    I have tried several different ways of coding the entry but no matter what no trades are opened; or if they are, they are very inconsistent and do not conform to the rules and appear to be random and I cannot figure out which part of the code is incorrect and was hoping someone may be able to suggest what I am doing wrong?

    Thank you

     

     

     

    #213643

    Your times are wrong. 9:00 a.m. is written as 090000.

    #213673

    Hi, thank you for your response, I have corrected all the time but no trades are still opening. Is there anything else wrong with the logic that you can see?

    #213680

    no matter what no trades are opened;

    Have you checked Closed Trades in the Detailed Report?  You may be opening and closing trades in the same bar and so they do not show under the equity curve?

    Also, try replacing Line 25 and Line 32 with Set Stop pLoss x and also comment out Line 36 to the end … just to get it going / taking trades.

    You can then uncomment back in to see which part of the code is stopping the strategy working correctly.

    Also include below at the end of your code to see when it is True.

    GRAPH other variables & conditions to see how the code is / is not working.

    A few ideas to try anyway, hope they help?

     

    #213712

    @kg6450

    Maybe my topic will interest you because they use more or less the same idea with a condition that exceeds the highest and in a certain time interval

    You can go directly to the last message even if I haven’t finished yet, it might help you

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