Previous candles with trend

Forums ProRealTime English forum ProOrder support Previous candles with trend

Viewing 3 posts - 1 through 3 (of 3 total)
  • #128517

    Hi. Have been trying to code for the current candle and previous candle(s) being in the direction of my moving averages.

    I set up 3 strategies. First strategy was the close of the current candle before opening a trade (c4)

    Second strategy was the current candle and the previous candle [1]

    Third strategy was the current candle and the 2 previous candles.

     

    In the attachment, you can see the current candle (before opening the trade) was in the direction of the moving averages.

    But the previous ones,[1] and [2], were not.

     

    Trading in demo mode. This did not work (see attachment).

    The  code was created in the program using simplified creation. So it should work.

    What am  I doing wrong? Any help greatly appreciated.

    Thanks in advance.

    #128519

    Note: I ran all 3 strategies and they all started the trade. Only the current candle (before trade) was correct

    #128527

    Your question is a bit confusing because you left the part about the averages out of it. In your image there are three averages – two going up and one going down!

    Your code only compares the close of the current candle to the opening prices of the previous candles. If you want to know if they were red or green then you need to do this:

     

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

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