MTF buy previous weeks high

Forums ProRealTime English forum ProOrder support MTF buy previous weeks high

Viewing 5 posts - 1 through 5 (of 5 total)
  • #90793

    I’m trying to use MTF to buy a breakout of the previous weeks high. The variable for last weeks high (hh) is correct as I have used the graph command to check it. If I set the default timeframe to 15 minutes the majority of trades are opened on a Friday @ 21:30, if I set the default timeframe to 1 hour it opens the majority to trades on a Sunday night @ 23:00. These entries are not when the previous weeks high was broken (breakout), can anyone help ? Code is below

     

     

    #90800

    Try replacing line 3 with:

    Moreover, are you using end-of-day data?

     

     

    #90822

    Hi Roberto,

    Thanks for the reply, I’ve changed line 3 as per your recommendation which does change the results, however the entries still aren’t as expected. There’s still a lot of entries on a Sunday @ 23:00 which is when the market opens and not when the previous weeks high is broken.

    Not sure what you mean by end-of -day data. I launch PRT through the IG platform.

    As I mentioned the hh variable which is set in the weekly timeframe is picking up the correct price, i.e Wall St high last week (Jan 27th – Feb 1st) was 25191, yet a trade has been opened on Sunday 3rd Feb @ 23:00 @ 25004 which isn’t higher than 25191.

    #90837

    Your line 3 retrieves the previous week’s HIGH, so the trade entered un Sunday 3rd (my test entered it on Friday at 21:15 utc+1), but that week’s HIGH was 24863,7 (24864) and it correctly entered a new trade because the trade before had already been closed at 210000 on that Friday.

    There are 2 points you have to correct/watch:

    1. since you close on Friday at 210000, if conditions in line 9 are still valid on next bar (which will be late Friday or the first bar of the next week) it will open a new trade. You may define a trading time to stop on Friday which does not just close open trades but also prevents further trading till Monday
    2. HIGH[1] retrieves data from the previous bar, while HIGH from the current week, so if UPDATEONCLOSE is used then that data will refer to the previous bar of the last weekly bar closed (currently, as of this writing, the bar closed on Jan. 25th) while using it as you did HH will retrieve data from just the bar previously closed being this week the current one (the week closed on Fab. 1st)

    This is almost the same code as yours with a trading time end and without UPDATEONCLOSE (which is likely to be what you want):

    don’t worry about TIMEFRAME(default) duplicated, you can enter it as many times you want. I added it for clarity, since when no TF is showed, the DEFAULT one is assumed.

    Give me some feedback after testing it.

     

    #90911

    Hi Roberto,

    I’ve tested your code above and it does exactly as I want, it’s now buying the breakout of the previous weeks high. I just need to work out the best timeframe to run the strategy on as the results differ depending on the time selected (5 min, 15 min, 30 min).

    Thanks for your quick response and help, much appreciated.

    1 user thanked author for this post.
Viewing 5 posts - 1 through 5 (of 5 total)

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