Counting green candles

Forums ProRealTime English forum ProOrder support Counting green candles

Viewing 8 posts - 1 through 8 (of 8 total)
  • #209997

    I am trying to code a backtest of a strategy, where I need to count the green candles to get my exit signal. Exit is on close of the first red candle after 3 green candles. Any ideas as to how I code that? I only have part of an idea – something with fractions and true or false. But even if that works – which it doesn’t right now – I still haven’t solved the exit on the red candle. Hope to hear your ideas. Half solutions or quater solutions are more than welcome!

    Thank you and hope you write some great stuff today 🙂

    #209998

    Sthg like that…

     

     

    1 user thanked author for this post.
    #210005

    Hi JC

    Thank you! That is so cool. Had no clue the summation could be used like that. And of course the red is as simple as that.

    Thank you!!

    #210341

    Hi again

    I’ve tested it on several instruments and I think it comes back with an exit after 3 green bars and one red in a row. Do you have any ideas for 3 green bars mixed with red bars (and then one red after that). There can be red bars mixed in between the 3 green ones.

    All the best.

    #210351

    How many reds allowed between 1st and 2nd green, and between 2nd and 3rd green?

    #210355

    As many as it takes. Let’s say 15.

    #210449

    Ok, I’ve made the 15 a parameter Nredmax you can change if you want to. You just have to define your entry conditions before trying it. To be tested.

     

     

    1 user thanked author for this post.
    #210463

    Thanks for taking the time to do this!

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

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