Coding 5 consecutive higher close

Forums ProRealTime English forum ProOrder support Coding 5 consecutive higher close

Viewing 2 posts - 1 through 2 (of 2 total)
  • #238524

    Hi everyone!

    I am very new to coding algos for use in prorealtime and I was wondering if someone could help me with a simple question:

    I want to define a requirement to enter trades for example that in order to go long on market the close of all 5 previous bars has to be higher than the previous bar, e.g.

    What would be the proper way to code this?

    Thanks a lot!

    Kind regards

    #238525

    Hi,

    for each close higher than previous close 5 times in a row, the long and boring way would be:

     

    but you may write it faster with:

     

    Moderation points:

    – please take into account forum usage highlighted in yellow box at bottom of current page, in this particular case title choice (in order to avoid all ropics in the forum named “help needed”), thanks. I’ll edit your title to replace the “coding help…” with something telling readers about the actual content to decide opening it or not. For example: “coding 5 consecutive higher close” (unless the query itself was misunderstood).

    – also moving topic from probuilder forum (indicators) to proorder forum (backtests and automatic strategies sending orders)
    1 user thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

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