Count Crossovers and Crossunders

Forums ProRealTime English forum ProOrder support Count Crossovers and Crossunders

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

    Hi,

    I’m trying to count the number of times a short moving average crosses over or crosses under a long moving average over a number of bars. Any help would be gratefully received.

    #15361

    Hmmm this question of “how much time something occurred in the past through x bars ” have been asked many times. I assume I should make a video for this 🙂

    So firstly, you have to define how much bars you want to lookback:

    Then define the conditions you’d like to be tested through this lookback period:

    Finally, count how much time this “c1” condition returned true (so condition value would be 1) in the past with the summation instruction:

    Now you have your variable x which contain the number of times the condition “c1” occurred through “lookback”. Happy testing.

    3 users thanked author for this post.
    #15370

    Nicolas thanks – and apologies. I assume if had looked harder I would have found the answer in your other posts. Really good of you to help me out and very much appreciated. Nick

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