buy at a new all time high

Forums ProRealTime English forum ProOrder support buy at a new all time high

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

    Looking for the entry condition to buy at a new all time high? Whats the code?

    #101207

    It’s the number of previous bars you want to test that makes a high as the all-time high or not.

    If you run your code on a 1-minute TF, even with 1M bars (v11 will allow this huge number), you’ll get the highest high of roughly the last 3.5 years, while on a MONTHLY TF that would go back way more, thus making that high as a very likely all-time high,  since that instruments was first recorded as computer data, of course.

    Anyway the code would simply be:

    “n” is the lookback number of bars. Bear in mind that ProOrder won’t allow 1M, neither 100k, as “n”, though I don’t know exactly. I know that max. preloaded bars can be 10,000.

    You could suggest supporting a new function, beyond HIGHEST and LOWEST:

    ALLTIME(high/low)

    to get the highest/lowest value since the very beginning, no matter what TF.

    1 user thanked author for this post.
    #101263

    You could also calculate in real time the new “all time high”, if you don’t want to use a predetermined period.

    Of course the all time high will depend of the history loaded. In the above example, you will also have to exit the order once in a while (depending of your conditions, e.g. takeprofit, stoploss, trailing stop, ..) to be able to re-enter in the market when a new breakout occurs.

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