Central Bank Dealers Range – Reversal strategy Help please!

Forums ProRealTime English forum ProBuilder support Central Bank Dealers Range – Reversal strategy Help please!

  • This topic has 29 replies, 5 voices, and was last updated 1 day ago by avatarJS.
Viewing 15 posts - 1 through 15 (of 30 total)
  • #232841


    I have tried to make an indicator for a range breakout reversal strategy – It’s called the central bank dealers range. The original strategy works as below,

    On the 15 min Chart – If the time 7pm to 1am take the open or the close price of the highest candle and the lowest candle of the range 7am-1am. then if the market stretches and goes up to 1.5 or 2 standard deviations before 10am of that range enter short, the Stop loss is at 3 of that range. The target will be at 50% inside the range. the whole thing should not trigger if the time passes at 10am next day after london session.

    The indicator works and shows what I need but the problem is I can not change the time 7 pm to 1am. it can make any range after 1 am though? any reason for that? Please can anyone help to build this? Massive help?


    I have attached pics to see if it make any sense? of the the strategy. Please kindly if anyone can let me know what I do wrong in here.

    Thank you all in advance





    I can not change the time 7 pm to 1am

    Just an observation … the only times you have in your code are Lines 10 and 11 (4:15am and 7:15am) is this correct?

    starttime = 041500
    endtime   = 071500
    Do you need …

    starttime = 190000
    endtime   = 010000


    1 user thanked author for this post.

    Hi @GraHal

    Thanks very much for your attention.

    yes I need the box to be on the 15min chart

    starttime =  190000
    endtime =  010000

    but when I change it never appears. I don’t know why? it only go back to starttime =  010000 onwards!


    I think you need some code in there to define that 070000 is the previous day.

    Just as a trial, see if below works logically?

    starttime = 010000
    endtime   = 040000
    1 user thanked author for this post.
    Thanks GraHal
    starttime = 010000
    endtime   = 040000  works perfectly. but cant go beyond that 🙁 I think the initial attached code above is also from 1am to 4am. but trying to find a way that goes to previous day starttime =  190000 and endtime =  010000
    This should be a strategy but you can see I’m not capable of making the indicator properly..  making up a strategy is a but far away for me. I have attached the pic of the strategy should look like! 🙂


    You use an “IntraDay” time frame (15 min) and “intraday” times run from 00:00:00 (reset IntraDayBarIndex) to 23:59:59… so, all the times you use in your code are related to the current (intra)day …

    1 user thanked author for this post.

    This should be a strategy

    Idea … concentrate on making the code into strategy and then optimise those times to see what the best few hours are.

    If ‘best few hours’ turns out to be 7pm to 11pm or even 11:45pm then your 7pm to 1am may have some basis.

    But if when optimised 1am to 6am gives most Gain then run with that?


    1 user thanked author for this post.

    Hi.. As @GraHal mentions original code ‘s start and end time on same day however you want start and end on different days.

    Another thing is that the Higher high/low values are reset when intradaybarindex resets which I think is 23:00:00, so range between HH and LL wouldn’t be over the whole time window either.

    HH and LL now reset at start of time window and flags ensure endtime not valid till start time reached.

    Try this,  compare it with other, on a time setting that work in both and see if levels are the same.




    1 user thanked author for this post.

    Hi @druby,

    It works very well and now I can change it to any time. Thank you all for your kind attention on this.

    Even though the Original strategy’s time scale is at 19.00 to 01.00 as central banks dealers range, as @GraHal mentioned, it should be tested at different times as well. I have tried to use your cording and tried to create a strategy but failed miserably.

    Please will you be kind enough to check what I have done wrong?

    Take profit both should be at the 50% of the middle range of the box – I have no idea how to get that

    Also is there a way to add if the whole thing did not get trigger at 10am that everything will cancel?

    Thank you once again GraHal,druby and @JS






    Try this, I did a back test run it on DAX 15min seems to do something



    Hi druby,

    Thank you very mcuh for this.. for some reason probacktest or detailed report won’t show in my chat ;( I saved it but it doesn’t load up. can’t see anything? Is it because I’m using PRT with IG? 🙁 🙁  it has never happened before!! Please can you advise Please.. 🙁


    On win11, IG, I used  snipping tool to crop an image of desktop area.

    Alternate, you can use the share feature from the top right hand side of Detailed report, ‘Save’ saves an image.

    Below, in the reply section, Attachments [Select File] click!, then navigate to the location of the required image file, select  file and then click ‘open’.

    Image should be previewed in attachment section..

    One other thing, Attachment only show up when viewing  AND your logged in .

    At times you get automatically logged out. IF use several devices maybe that one has logged out.


    1 user thanked author for this post.

    Hi druby

    Thanks, it worked. I tried your coding it takes the entry perfectly I think but somehow trade trigger and exit at the same time. please can you have a look at the pics below on EURUSD on the 14 MAy. The trade trigger but instead of going into TP, it straight exits simultaneously with a loss! tried to change things but did not work!  also is the trigTime 100000 means if the price goes to the entry-level anytime before 10am will trigger the trade I guess?

    Sorry, I know I’m asking you loads of questions.. I like to see what happens I have been trying this manually for a long time but its tough!

    Thank you in advance


    I’m not 100% on this but, on lines 58 and 69 we have ‘IF ON MARKET THEN’ where, line 58 set the short stoploss and line 69 the long stoploss.

    So when long limit order triggered, line 66, and order executed, (on market) the stoploss and target are set.

    Now since on the market, the next run through of the code sees the line 58 ‘IF ON MARKET THEN ‘ again and reset the stoploss to the short stoploss.

    Since both targets are the same level the change doesn’t affect those.

    However, in a long trade the stop level is set below the price, and if price goes below it, the stop is triggered, but when it’s now changed to above the price, effectively the price is below the short stoploss level and triggers, out of market.

    So if this is what’s happening then the lines need to be changed to:



    This would remove this conflict.


    On another point,  if a position only exits if the stop or target met, and every day a new stop and target are calculated, then depending on price movement the new stop and targets would be the active ones.

    So if in a position, it appears possible for these moving stops and targets and price movements, to make a target bigger than was originally set, and opposite for the stoploss, making it worse than originally set.

    This all if trade triggered before the 10am cut off point, but trade could last, lets say days, and who knows were stop and target will be on that day.

    If that’s not your intension then the logic around the stop and target need some thought.

    This is if, i’m seeing this all right!


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

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