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
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.
KumoNoJuzza Thank you @philippe59139 !! We finally have the VAL / VAH to play with. Could you attach th...
yanntorp Merci @pilippe59139 pour le travail que vous partagez. Vos programmes sont vraiment au top.
philippe59139 Merci Yanntorp
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Fgats https://www.prorealcode.com/topic/indicateur-3-sigma-documentation/ lien pour la documentat...
DELBERT Bonjour , merci pour le partage et la traduction , je vais essayer d'assimiler ce nouvelle i...
Iván
3 months ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
3 months ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Raspete01 Buenos días Iván, estoy intentando llevar el código eliminando los colores y pasando un Back...
jacquesgermain sì da aggiungere
Maik2404 auf welchen Wert muss ich die Kompresionsperiode stellen?
jacquesgermain — Période de compression : ce paramètre détermine la période de rétrospection utilisée pour ...
Iván
3 months ago
ARLEQUIN49 Hello Ivan, Would it be possible to convert the code of this QQE MOD indicator which accomp...
ARLEQUIN49 here is the code: //@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = i...
Iván Hi, Yes I can translate it but please, create a new topic for it.
philippe59139 Bravo super travail
gidien
4 months ago
gidien Thanks for the hint. I think i know now, why this happen. The "settings" block was added by ...
LucasBest Thank you for sharing your work, both original and very disconcerting. When I went through t...
gidien Hello LucasBest, thanks for your comment. Point 1: Yes your are right. The Zigzag ve...
gidien
4 months ago
Cram13 Bonjour, qu'elles sont les valeurs des variables ? Avec mes remerciements Marc
gidien This indicator will not return any value. You can change the last line to : return ao...
gidien SMA1 = MovingAverage Length applied to the source candles (high , low, op...
Fgats quelques explications en Français ici : Some explanations in French here : https://www.p...
Nicolas Merci pour cette contribution, j'apprécie ! :)
Fgats Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
Msport71 Thank You very much
luxrun A question: what are the initial (or default) values ​​of maximum and minimum in the executi...

Top