Coding for high and low between set hours

Viewing 15 posts - 16 through 30 (of 39 total)
  • Author
    Posts
  • #7462 quote
    Dave Charles
    Participant
    New

    You are truly amazing Adolfo!

    Thank you so much! You are a PRT wizard!

    #7465 quote
    Jeff
    Participant
    New

    Wow, this is brilliant well done Adolfo. This works great.

    #7471 quote
    Jeff
    Participant
    New

    Hi Adolfo, I just uploaded your file, its really good,

    but i am 1 hour past the close. Is there setting i can change to bring the close back 1 hour.

    Can i use these figures for my pivots as well, i guess i just need the figures for the high low close.

     

    Thanks Jeff

    #7473 quote
    Adolfo
    Participant
    Senior

    Hi Jeff! Gotta check it, but is posible your time is GMT+1 instead my one GMT+2??

    BRB

    #7511 quote
    Adolfo
    Participant
    Senior

    @Jeff 

    This indicator is starting to show yesterday max and min between 10:00 to 16:00 at 01:00 each new day in order to know wich timeframe are we using. Dave wants to be switching timeframes and for this reason is working from 1m to 1h chart.

    If you are using an specific timeframe, it will be easy to modify, just tell me wich timeframe are you using.

    Should be something like this :

    IF DAYOFWEEK=1 THEN // Monday
    MAXIMO = CashHighFr
    MINIMO = CashLowFr
    CashClose = DClose(1)
    IF TIME = 160000 THEN
    CashHighMo = Highest[x](high) // "x" Should be changed to the number of bars between 10:00 to 16:00 in our timeframe i.e.( for 15m chart will be 24)
    CashLowMo = Lowest[x](low)
    ENDIF
    ENDIF
    
    IF DAYOFWEEK=2 THEN
    MAXIMO = CashHighMo
    MINIMO = CashLowMo
    CashClose = DClose(1)
    IF TIME = 160000 THEN
    CashHighTu = Highest[x](high)
    CashLowTu = Lowest[x](low)
    ENDIF
    ENDIf
    
    IF DAYOFWEEK=3 THEN
    MAXIMO = CashHighTu
    MINIMO = CashLowTu
    CashClose = DClose(1)
    IF TIME = 160000 THEN
    CashHighWe = Highest[x](high)
    CashLowWe = Lowest[x](low)
    ENDIF
    ENDIF
    
    IF DAYOFWEEK=4 THEN
    MAXIMO = CashHighWe
    MINIMO = CashLowWe
    CashClose = DClose(1)
    IF TIME = 160000 THEN
    CashHighTh = Highest[x](high)
    CashLowTh = Lowest[x](low)
    ENDIF
    ENDIF
    
    IF DAYOFWEEK=5 THEN
    MAXIMO = CashHighTh
    MINIMO = CashLowTh
    CashClose = DClose(1)
    IF TIME = 160000 THEN
    CashHighFr = Highest[x](high)
    CashLowFr = Lowest[x](low)
    ENDIF
    ENDIF
    
    return MAXIMO AS "LAST DAY MAX",MINIMO AS "LAST DAY LOW",CashClose as "Cash Close"
    
    
    
    Remember: “x” Should be changed to the number of bars between 10:00 to 16:00 in our timeframe i.e.( for 15m chart will be 24)
    Jeff thanked this post
    #7520 quote
    Cosmic1
    Participant
    Senior

    Thanks for this info, I want to scan between 1430-17 on 1min chart for the current day everyday. I think I’ve looked at too much code this week and been trying wrap my brain around this but keep hitting a brick wall. Can you help with the right code?

    #7523 quote
    Jeff
    Participant
    New

    Thank you Adolfo for your reply, i was waiting for reply and didn’t think to look for 2nd page. I’m in Australia but Use +1 on my charts , i  use similar time frames to Dave 1 min to I hour. But mainly 5 mins.

    I can change my time frames what ever suits the code. My brain has been on overload trying to figure this out well done mate.

    Jeff…..

    #7524 quote
    Jeff
    Participant
    New

    Ok this is what i put in for my 5 min chart using GMT +1 for ASX200. High and low are perfect put close is on the midnight close price.

    Thanks Jeff

    IF DAYOFWEEK=1 THEN // Monday
    MAXIMO = CashHighFr
    MINIMO = CashLowFr
    CashClose = DClose(72)
    IF TIME = 070000 THEN
    CashHighMo = Highest[72](high) // “x” Should be changed to the number of bars between 10:00 to 16:00 in our timeframe i.e.( for 15m chart will be 24)
    CashLowMo = Lowest[72](low)
    ENDIF
    ENDIF

    IF DAYOFWEEK=2 THEN
    MAXIMO = CashHighMo
    MINIMO = CashLowMo
    CashClose = DClose(72)
    IF TIME = 070000 THEN
    CashHighTu = Highest[72](high)
    CashLowTu = Lowest[72](low)
    ENDIF
    ENDIf

    IF DAYOFWEEK=3 THEN
    MAXIMO = CashHighTu
    MINIMO = CashLowTu
    CashClose = DClose(72)
    IF TIME = 070000 THEN
    CashHighWe = Highest[72](high)
    CashLowWe = Lowest[72](low)
    ENDIF
    ENDIF

    IF DAYOFWEEK=4 THEN
    MAXIMO = CashHighWe
    MINIMO = CashLowWe
    CashClose = DClose(72)
    IF TIME = 070000 THEN
    CashHighTh = Highest[72](high)
    CashLowTh = Lowest[72](low)
    ENDIF
    ENDIF

    IF DAYOFWEEK=5 THEN
    MAXIMO = CashHighTh
    MINIMO = CashLowTh
    CashClose = DClose(72)
    IF TIME = 070000 THEN
    CashHighFr = Highest[72](high)
    CashLowFr = Lowest[72](low)
    ENDIF
    ENDIF

    return MAXIMO AS “LAST DAY MAX”,MINIMO AS “LAST DAY LOW”,CashClose as “Cash Close”

    #7525 quote
    Adolfo
    Participant
    Senior

    Hey Jeff!

    You were so close!! Your error was in Dclose(1) you put 72, why?

     

    72 is perfecto for highest and lowest vars, it gives you high and low of the last 6 hours that’s perfect. Just change 72 to 1 in Dclose

     

    King Regards


    #7526 quote
    Adolfo
    Participant
    Senior

    By the way, DClose(1) gives you back last day close price. If you want a diferent close it could be changed.

    I will help you if needed 😉

    Jeff thanked this post
    #7527 quote
    Adolfo
    Participant
    Senior

    I want to scan between 1430-17 on 1min chart for the current day everyday.

    This is the code for 1m to 1h charts. Shows previous day (14:30-17:00) high and low and last day close price, isn’t it?
    4,5 hours will set base variable to 270 and that’s it.

    Here you have:

    REM ESTABLISH MAX AND MIN EACH DAY OF WEEK
    base = 270
    periodo = 006000-horaanterior
    n = abs(round(periodo/100))
    x = abs(round(base/n))
    
    IF TIME=010000 THEN
    horaanterior = Time[1]
    endif
    
    IF DAYOFWEEK=1 THEN
    MAXIMO = CashHighFr
    MINIMO = CashLowFr
    CashClose = DClose(1)
    IF TIME = 170000 THEN
    CashHighMo = Highest[x](high)
    CashLowMo = Lowest[x](low)
    ENDIF
    ENDIF
    
    IF DAYOFWEEK=2 THEN
    MAXIMO = CashHighMo
    MINIMO = CashLowMo
    CashClose = DClose(1)
    IF TIME = 170000 THEN
    CashHighTu = Highest[x](high)
    CashLowTu = Lowest[x](low)
    ENDIF
    ENDIf
    
    IF DAYOFWEEK=3 THEN
    MAXIMO = CashHighTu
    MINIMO = CashLowTu
    CashClose = DClose(1)
    IF TIME = 170000 THEN
    CashHighWe = Highest[x](high)
    CashLowWe = Lowest[x](low)
    ENDIF
    ENDIF
    
    IF DAYOFWEEK=4 THEN
    MAXIMO = CashHighWe
    MINIMO = CashLowWe
    CashClose = DClose(1)
    IF TIME = 170000 THEN
    CashHighTh = Highest[x](high)
    CashLowTh = Lowest[x](low)
    ENDIF
    ENDIF
    
    IF DAYOFWEEK=5 THEN
    MAXIMO = CashHighTh
    MINIMO = CashLowTh
    CashClose = DClose(1)
    IF TIME = 170000 THEN
    CashHighFr = Highest[x](high)
    CashLowFr = Lowest[x](low)
    ENDIF
    ENDIF
    
    return MAXIMO AS "LAST DAY MAX",MINIMO AS "LAST DAY LOW",CashClose as "Cash Close"
    
    #7585 quote
    Cosmic1
    Participant
    Senior

    Hi, thanks for your help but I want to scan the current day price action for the high and and low from the period 1430-1700 and then a trade will follow after this time if those high/low are broken.

    #7589 quote
    Jeff
    Participant
    New

    Hi Adolfo

    Sorry i missed your message last night, i had to go to bed for an early start today. I changed my settings back to Dclose.

    I thought if i had 72 in the close it would give me the actual market close price (070000) 7am on the ASX. (Using GMT +1 )

    And Same for FTSE i want to see the close price at 16:30pm . but the price i see is 12am (Midnight) using Dclose.

    High and low work perfect.

    I will keep trying, as i am learning all the time.

    Thank you again for your time and help, really appreciated.

    Jeff..

    #7590 quote
    Jeff
    Participant
    New

    Hi Adolfo

    In the code it  it has TIME =07000 (Using GMT+1) can i use that and thaEn -1 bar? which will give me the close time.  (065500)

    CashClose = TIME [1]
    TIME = 070000 THEN

    Jeff.,

    #7591 quote
    Adolfo
    Participant
    Senior

    Gm Jeff! If you want the close price at 16:30 to be printed the rest of the day, include this:
    If time=163000 then
    Myclose = close
    Endif
    Variable Myclose will be updated everyday at 16:30 or whenever you choose.

    Btw, Dclose[72] is refering to close of 72 days back. Dclose is “Day Close”.

    Brb in a few hours, have a nice day!
    Jeff thanked this post
Viewing 15 posts - 16 through 30 (of 39 total)
  • You must be logged in to reply to this topic.

Coding for high and low between set hours


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 38 replies,
has 1 voice, and was last updated by Velociraptux
4 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/18/2016
Status: Active
Attachments: 8 files
Logo Logo
Loading...