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
luxrun A question: what are the initial (or default) values ​​of maximum and minimum in the executi...
jacquesgermain Bonjour non pas de soucis car src=customclose donc dans le menu configuration/propriété me...
geroniman Merci Jacques , indic tres utile. J'ai un indic à programmer avec du price action. es tu dis...
jacquesgermain ok pour regarder ...
Bateson
6 months ago
Bateson
6 months ago
Quino
6 months ago
Bateson
6 months ago
MACD Reloaded
MACD Reloaded
2
Indicators
NEOMKEY Nada nuevo
Carlose I love your version of the MACD, if you use it you can get a lot of use out of it, for me ma...
Bateson
6 months ago
TSI 3.0
TSI 3.0
6
Indicators
Fgats a = (Average[l1,m1](Average[l2,m2](ROC[mfvalue](close)))) b = (Average[l3,m3](Average[l4,m4...
Bateson Fgats, Un grand merci. Cela fonctionne parfaitement. J'ai bien compris la partie à rajouter ...
Fgats
7 months ago
bousalahane hello, thank you for sharing, I’m not top strong in the programation part, there is a way to...
Fgats Hi, With this indicator I just wanted to show the interest that can exist to synthesize th...
davidguerreir how to adapt nbStdSig values ?
lkiklkik thanks a lot. description of the indicator seems wrong ...
robertogozzi Sorry, you're right. The correct description, from https://www.tradingview.com/script/omlpq...
carlvan Hi Nicolas, thank you for this very interesting code. There is something I don't get though ...
Atemi19 probleme code : message veuillez definir alpha futur nbO X X1Y y1
Xtian Bjr Nicolas , pour exemple cet indicateur est extrêmement bien développé chez trading view ...
Actaru5 Hi, I couldn't see the candles well. Changing the code solves the problem. from line 164 to...
LucasBest Thank you
Alai-n @LucasBest Hello, do you think it is possible to isolate moving averages? I would like to us...
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
finplus Bonjour, une petite demande concernant cet indicateur : comment faire pour que lorsque la bo...
LucasBest Bonjour, la coloration des bandes se fait ligne 111 et 112 à l'aide des instructions colorbe...
Matriciel Very nice job ! Is it possible to do the opposite because what interests me is to have the ...
YvesRobert Hi Matriciel, how can we do this, because stochastic is limited between 0 and 100 but price ...
Traderfox06 Dear zeiiermantrading, I really like your approach combining adaptive averages with MACD in...

Top