First hour of trading average high and low

First hour of trading average high and low

This indicator was needed by Roman.

The upper line shows the highest of the first hour plus the average for the past n days of the difference between the first-hour-highest and the daily open.

the lower line shows the lowest of the first hour minus the average for the past n days of the difference between the first-hour-lowest and the daily open.

I hope someone else might use this code.

Blue skies

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. Maz • 04/28/2017 #

    Hi, I quite like this idea. I just wanted to suggest some code alterations:
    // --------------------------------
    // once period = 20
    // once gmtOffset = 000000 // 010000 for EU just an idea
    once startTime = 080000 //+gmtOffset ??
    // --------------------------------

    once endTime = startTime+010000
    // to avoid nasty spike on the graph
    once up = undefined
    once down = undefined
    once super = undefined
    once infer = undefined

    //computation timeframe in use and intraday number of bars - intrab
    if intradayBarIndex = 0 then
    time1=opentime
    elsif intradayBarIndex = 1 then
    time2=opentime
    // only needs to be done once a day no?
    deltatime=(time2-time1)/100
    intrab=round(522/deltatime)
    endif
    //deltatime=(time2-time1)/100
    //intrab=round(522/deltatime)

    //computation max and min in the first hour - super e infer
    if (time>=startTime) and (time<=endTime) then
    super = dopen(0)
    infer = dopen(0)
    //if high>super then
    //super=high
    //endif
    super = max(high, super)
    //if low<infer then
    //infer=low
    //endif
    infer = min(low, infer)
    endif
    //else
    //super = super // ??? why?
    //infer = infer // ??? why?
    //endif

    //computation average (super-initialopen) and (initialopen-infer)
    if (time = endTime) then
    sommadeltasuper=0
    sommadeltainfer=0
    for i=0 to (period) do
    j=1+round(i*intrab)
    sommadeltasuper = sommadeltasuper+abs(super[j]-dopen(i))
    sommadeltainfer = sommadeltainfer+abs(dopen(i)-infer[j])
    next
    deltasuper = sommadeltasuper/period
    deltainfer = sommadeltainfer/period
    //endif
    //if time>endTime then
    elsif time>endTime then
    up=super+deltasuper
    down=infer-deltainfer
    else
    up=up
    down=down
    endif

    return up,down

     

  2. gabri • 04/28/2017 #

    Maz,
    excellent corrections, thanks a lot
    Gabri

  3. Francesco78 • 04/28/2017 #

    Thank you, what is the rational? breakout outside the rectangle?
    Regards
    Francesco 

  4. gabri • 04/28/2017 #

    Roman made the strategy, I made the code and Maze made it bulltproof. You can use it I believe in many ways. A London breakout might be one of them for example.
     

  5. Roman • 04/28/2017 #

    Francesco78
    here is the strategy:
    https://www.prorealcode.com/topic/highlowopen-prices-for-specific-timeframes/

avatar
Register or

Likes

avatar avatar avatar avatar avatar
Related users ' posts
Iván
1 week ago
Madrosat Bonjour Ivan je ne sais pas si je dois écrire en Français ,anglais ,espagnol ,il y a les 3 ...
Iván Bonjour, la vérité est que ce n'est pas aussi facile qu'il n'y paraît.... Un indicateur peut...
Madrosat Merci Ivan j'espère que ce jour viendra bientôt , je sais que ce n'est pas facile car les in...
Iván
3 weeks ago
Madrosat Bonjour ivan Quelle différence il y a t il entre Extra trend et ultra trend lequel est le p...
P. Marlowe Muy bueno. ¿Podría hacerse para señalar extremos por el lado bajista? Lo mismo a la inversa....
Miro Esta es una versión del indicador, para ambos extremos. //-------------------------------...
P. Marlowe Muchas gracias ¡¡
Iván Hi. You could add these lines of code: if intradaybarindex=0 then varhigh=round((dhigh(...
RTR Edit
@toniyecla ¡gracias! más capturas aqui: https://www.prorealcode.com/wp-content/uploads/2024/10/IC...
robert123 I had a go at the 'order block' version- badly done I'm sure....but a start. // Sonarlabs ...
robert123 take ''sens1 = 5'' out and put ''rango'' in as variable
@toniyecla captura: https://www.prorealcode.com/wp-content/uploads/2024/10/sesiones_v3.png
@toniyecla y más opciones: añade una línea también en sesiones EUROPA y USA (configurable) y un texto o...
@toniyecla // Author: toniyecla - contact@rescommunesomnium.com // VARIABLES // EspHorarioVerano (b...
Alai-n Hello, take a look at this formulation made by "Blade106", Topic link attached post #227334....
@toniyecla ¡interesante acercamiento! (no lo conocía, simplemente tuve la necesidad y lo programé) pers...
Iván
1 month ago
MaoRai54 dear Ivan, it seems to be very interesting but please clarify what are all the lines I see i...
Iván Hi! you have the answer in the last line of code... MacdMiddle as "histo" style(histogra...
kats Le Top , a utiliser avec le nuage violet et alerte TN pour plus de précision.
roccafragius Hello Ivan, another great Indicator, very useful to trace the trend ( blue line) and the pos...
roccafragius Hello Ivan, very good job! May I ask you to translate teh script from TradingView named Tre...
Iván Hi! yes. You can ask for it here: https://www.prorealcode.com/free-code-conversion/
roccafragius Thank you so much Ivan! I created this request in english Translate from TradingView Indicat...
Regisnew très bel indicateur merci
jordan //---settings MAmode=0 Period=150 NumberOfMA=100 //---end of settings MA2=undefined ...
jordan dites moi si cela correspond à ce que vous cherchez
kats bonjour merci de ta reponse mais non ca fonctionne pas sympa quand même d'avoir essayé cdlt
Jean2139 Bonjour Yvan, Merci pour ton indicateur que je trouve très intéressant. Je suppose que tu ...
Suffi Hier eine kleine Korrektur: //-----Inputs-----------------------------------------// MALengt...
adeelq79 Hi Ivan, thank you for this indicator. Is it possible to include the volume of buys and sell...
achel J'ai la même erreur sur ligne 1 avec une importation dans les règles de l'art. Comment faire?
Iván Cela est probablement dû au fait que vous avez une ancienne version de l'outillage. Vérifi...
Iván
4 months ago
Iván Hola javier gracias! es importante realizar buenos backtest antes de lanzarse al mercado y ...
achel I have an error with "fillcolor" - How to solve this? / J'ai une erreur avec "fillcolor" - C...
Iván Hi! This is because you are not with V12. Just delete fillcolor

Top