Trading opening gap

Viewing 4 posts - 16 through 19 (of 19 total)
  • #227489

    four instances where it is true.

    So were trades opened?

    #227519

    please pay attention with cfd data what exactly prt indicates as day’s close & open (and high and low…). you can “graph” them e.g. on 1 min time frame and you will see for dax that “close” of the “yesterday” is in this case the close of the 1 minute bar which starts at 00:59:00 “today”, and “opening” of “today” is the opening of the bar which starts as right the next one, so at 01:00:00 “today”, e.g. picture attached. so time period between “close yesterday” and “opening today” being just millisecond/seconds there are basically have no gaps or to let’s say they are just fractions of points, in some cases very very few points.

    The four instances on 200k / 1min units backtest you mention – if I did my work correctly – are linked to some special confusion with data after weekends (you will find same/similar cases after other non-trading days like Easter or Christmas): prt treats monday’s data (sometimes also already sunday evenings data) from 00:00:00 till 01:00:00 as a separate “day”. So yep, you have those 4 instances where gap is > 0.002, but condition is true only until 01:00:00 and so not at 09:00:00 anymore (e.g second picture attached), hence system never “trading”.

    long story short: you might yourself define in the code what price at which time of the day you consider as day’s close and open – and then you will have “your” gaps and system triggering trade after trade😃 e.g. as with the code below.

    good luck!

    justisan

     

    2 users thanked author for this post.
    #229033

    Thank you for your reply. I agree with your reasoning about what exact times PRT counts as closing time for the previous day, and for the opening time of current day (see earlier in the thread).

    I think your idea about modifying the code is great, but I was wondering:

    if you tell PRT that ‘YClose = close’ and ‘TOpen = close’, doesn’t that mean that both YClose and TOpen get the same value?

    #229035

    Allow me :

    Haha, No. This is because YClose will receive the “closing” price as how it was on 22:00 (minus one bar) and TOpen will receive the closing price of how it was on 09:00 (minus one bar).

    🙂

Viewing 4 posts - 16 through 19 (of 19 total)

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