Buying as price crosses previous high

Forums ProRealTime English forum ProOrder support Buying as price crosses previous high

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

    Hi all,

    I’m trying to program a strategy whereby if a condition for the previous week is true, then I want the system to buy at the market as soon as the current week crosses above the high of the previous week.

    For instance:

    Week #23 = Signal is true

    System buys during week #24, as soon as prices trade above the high of week #23. See attached picture to describe what I mean.

    Currently, the code is buying at market on Week #25. I suspect this is because it only confirms that the high of W#24 is higher than the high of W#23 once W#24 itself is finished, which is too late for what I want.

    Any ideas?

    Thank you.


    Post your topic in the correct forum:
    _ ProRealTime Platform Support: only platform related issues.
    _ ProOrder: only strategy topics.
    _ ProBuilder: only indicator topics.
    _ ProScreener: only screener topics
    _ General Discussion: any other topics.
    _ Welcome New Members: for new forum members to introduce themselves.

    I moved it from ProBuilder.

    Thank you 🙂

    If you are using a weekly TF, the strategy can only verify that week #24 has broken the prior high (week #23) when week #24 closes, so the trade will open at the beginning of week #25.

    You need to use the MTF (Multiple Time Frame) support to use your strategy on a lower TF, such as daily or hourly. In such case the strategy will still be run at the closing of a bar, but closing daily or hourly (or even less), thus not having to wait a whole week.

    If you search this forum for the word MTF you will be returned many links to code snippets and info on that topic.



    You can use something like this. The second timeframe can be anything you want (as Roberto said), then just add the rest of your strategy.


    1 user thanked author for this post.
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