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
kats Bonsoir, cet indicateur est vraiment très bien avec plusieurs possibilités en coloration . ...
roccafragius Thank you Ivan for your indicators, very very interesting!!!!
kats Bonsoir, Pensez vous pouvoir répondre à ma question posée ci dessus? Ce serait vraiment tr...
kats bONSOIR Est ce normal que les droites se démultiplient en plusieurs droites quelle differe...
kats j ai fait une copie d'ecran mais je ne sais pas comment l'envoyer sur le site
Iván Thanks ;)
kats BONJOUR je lai mis sur du renko , il est complexe car toujours a l'envers??? Peut être ne ...
RTR Great tool again and great job, thank you! So from what I see everytime Z-Score is over 0...
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
P. Marlowe Impressive work. Accurate, interesting, good background. You hit the nail on the head again....
14starwberryhill Such a wonderful work, thanks Ivan..............
Iván Hi! You should change $rbox, $gbox and $bbox variables. Also r,g,b for last box.
finplus Thanks Ivan.
roccafragius Ivan, I just want to say you.. very very great job!!!! Thank you so much for this indicator!...
Iván
3 weeks ago
Iván Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
WhyAskOZ Hi, Ivan As always you are doing great coding. The code works on my PRT, however the issu...
Iván You can delete in the last line (return) the configuration for color. Delete coloured(xx,xx,...
Iván
3 weeks ago
Danger Zones Indicator
Danger Zones Indicator
2
Indicators
P. Marlowe Quite an impressive work, as usual. You share extremely useful tools and show an stunning ba...
Iván Thank you very much!
P. Marlowe Quite an impressive work, Iván. Extremely useful and accurate. Congratulations. Keep it up¡
lkiklkik i love it !!! thanks.
Stenozar Hi Ivan, can you translate from tradingviwe the EMA TREND METER INDICATOR? It couid be inte...
Iván Hi Yes I can. Please, create a new topic for that I will translate it.
Stenozar Hi Ivan, I've created a new topic about the indicator: https://www.prorealcode.com/topic/ema...
Iván sería así //------------------Inputs------------------------------ linreglength = 11//i...
Doddge Muchísimas gracias Iván, está genial.
superfalcio holaaa, have you run some statistics?
Doddge Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
RTR Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Iván Hi, Lines 62 and 63. These lines define buy and sell conditions.
el titi Bonjour, merci beaucoup pour ce partage. Je vais regarder avec attention ce script et analys...
Armand2020 Bonjour , super taf!! serait il possible de faire un poc dynamique en timeframe 5 min en mod...
philippe59139 voici ce qu'il faudrait faire ou ajouter: //poc dynamique defparam calculateonlastbars=1...
Iván
2 months ago
Iván I personally like it in daily timeframe
oliTR Many thanks Ivan, I copy/paste your code to try it but could only get a constant stable unif...
Iván Hi, I've copied the code above and it works... what asset are you trying? $indices array ...
francis59 Hello Ivan, thanks for this very nice and powerfull indicator. Could you have time to create...
Iván Hi We could find stocks with sweep on: //PRC_Sweep Institucional //version = 0 //28.0...
inverse Like the way you think Ivan ... :)
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
Gio56 Super idée. j'ai juste un souci. j'ai pas de barre verte mais plusieurs lignes de couleurs.....
DeathMetal change line in histgram, (click on indicator name, click on tool (
Gio56 Super merci.

Top