See the whole picture with daily gap levels and analysis on intraday charts with custom trading hours enabled

v10.3
See the whole picture with daily gap levels and analysis on intraday charts with custom trading  ...

It’s easy to get lost in the sea of indicators and strategies out there, but one thing that is frequently overlooked these days is the simple gap. Often this gives us a great steer as to market direction from the open, especially if the market is at important support/resistance or in ‘overbought’/’oversold’ territory. The DAX seems to be particularly ripe for gap trading.

My code considers not just today’s gap (relative to yesterday’s close), but the previous three days’. It’s up to you to decide how likely it is that each gap will fill (I wish I could write some code that could assist here, but suspect this is beyond the current scope of PRT – ideas welcome), but I think it’s quite neat to have these levels preloaded on your chart as you prepare for the day ahead.

The code gives you the ability to change the trading hours, which I think is important, though I also believe that the markets seem to respect 8am London time (9am CET) as the ‘official’ open and 4.35pm London time (5.35pm CET) as the ‘official’ close on which gaps are evaluated so for instance if the market continues to drift lower in the evening session and then then opens at a similar level the following day, it will still tend to seek out the 4.35pm close from the previous day even though the charts will show there is no gap per se. As I am based in the UK, those users in other timezones will have to adapt the respective times in the code to their own timezone.

Why not just use DOpen, DHigh, DLow, DClose with custom trading hours you may ask? Because it occurred to me yesterday (I may be mistaken) that even when you play around with the trading hours, the DOpen/High/Low/Close values remain the same, i.e. they reflect the respective values over the entire 24-hour session, or maybe it’s because I didn’t tick the ‘Apply settings above to non-intraday timeframes’. Anyway I feel more confident using my manually coded versions…

Please feel free to suggest how to expand/improve the code.

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. JOKAMAURICE • 06/27/2019 #

    Thank you but I don’t really understand. The values don’t fit with what I see on my chart. I don’t understand why I see at the opening an upside and downside gap.

avatar
Register or

Likes

avatar avatar avatar avatar
Related users ' posts
JohnScher Short variant, see at https://www.prorealcode.com/topic/late-lunch-trade-dax40-strategy/
DANY Hi JohnScher, Thanks a lot for your contribution. Consider this release to avoid overfit...
JohnScher Thank you so much for exploring the Late Lunch Strategy. For discussion and in answer to yo...
BenJuice JohnScher, merci de partager ta stratégie. Je suis nouveau dans ce domaine, sur ton code q...
JohnScher As a percentage of the price, here 2%. StopLoss as well as TargetProfit. SL and TP come ...
Wilko I absolutely love the simplicity of this mean-reversion strategy. Well done!
Patrice210 bonjour STANKO, effectivement la première ligne apparait en anomalie et je ne comprend pas v...
KumoNoJuzza Hi guys, Thanks @Stanko and everyone for your contributions. I have been playing around ...
Stanko Hi KumoNoJuzza, thanks for the post. I also tried your code with Dax and the performance is ...
snucke i dont think you understod the question. i did not ask about the band pass indicator. i as...
thomas2004ch Hi, Is this startegy suitable for daily SPY? Regards
ebous64 Je cherche à traiter des effets de bords avec un encadrement ajustable des variables. Vous a...
JohnScher Postscript: It's running in the live right now. One position after the other is opened. ...
ullle73 nice!! how's it been since your last post on going live? :)
thomas2004ch Hi, Is this strategy suitable for daily SPY? Regards
wally Hola soy nuevo en el mudo robots. Alguien seria tan amable de poner el archivo itf.file ya q...
Darren Nash I found this works well on the DOW
thomas2004ch Hi John, Is your strategy suitable for daily SPY? Regards
cdc.andersson Hello, I´m trying to paste the code and start testing but can´t get it to work in PRT. Shoul...
Lupo32 Thank You Aaron
superfalcio I'm having no more issue on the new Prorealtime release 11.1
Zigo
4 years ago
oliverkeim Hi, also here not working. Only white lines.
killerplatuze Dont work anymore with the current version?
KryptoKat tolle Arbeit, professionell
FXmike hey my friends, thank you for this great code. my problem is he make no trade open. backtest...
FXmike Can i put a Action that my start contract is smaller than 1 ? 0.3 or 0.5 ? In wich Position...
phoentzs I wrote the code for M15 back then and also variants in H1 and M1. Everything works so far....
Maxime Baudin Very useful! Thanks Mat, and Happy New Year
nicko Great work. Thank you. However I am having trouble getting it to print in the first bar. If ...
Jan Wind Thanks for sharing ! The Gain/Loss ratio is a bit low, 1,16, hardly offset the risks take...
drive whats the period ?
Lucas0000 Hola. estoy buscando un programador en proorder, para hacer un programa basado en el Q-trend...
Ludwig Bonjour Merci pour le code, je souhaite intégrer un break even et mette en place un réinves...
superfalcio hello, this strategy is pretty interesting, anyway on index after diferent suggestion and im...
Fralex Hello everyone I optimized the original “LongOnly-DAX-4H-TMA-Channel” algorithm over a pe...
Om Hello, thanks for sharing! Getting a message that Variable P is undefined?
matin Intraday Average Volume Indicator Not working, what can i do plz
Dom Hello, hello....je commence le trading et découvre par la même occasion le codage....et ce n...
Nicolas Merci, ça fait plaisir !
Be-n Bonjour tout le monde ! Dans l'indicateur de tendance, j'ai du mal à saisir la nuance entre ...
YvesRobert @robertogozzi. It's done. Thank you
YvesRobert Hello Roberto, some questions about your strategy. 1 - Do the 2 lines SET TARGET pPROFIT T...
robertogozzi 1. The 2 lines SET TARGET pPROFIT TP and SET STOP pLOSS SL are always executed, each bar. Bu...
avatar
Anonymous Hi robertogozzi - thank you very much for sharing this strategy. I have performed various ...
robertogozzi Thank you samsampop.
Dotan Hello guys I really appreciate this coding effort but can I use this code for Mt5 Forex Trad...
Gubben So far so good. After a long drawdown it was winning four times in five weeks. Since 24 jul...
pat95162 Salut Pourquoi je n'ai pas les même résultats que vous
UkCoopDownUnder Any hints for us, on which variables we should be optimising ? As of November 2020, the cu...
Peter I recognized a possible problem with the timeframe / Defparam variables. As far as I know, t...
superfalcio Hello Peter, it is long time i have been watching this strategy, very good and interesting ...
Peter I indeed do have different modified strategies in the market. In the past my variants perfor...

Top