Coding for high and low between set hours
Forums › ProRealTime English forum › ProBuilder support › Coding for high and low between set hours
- This topic has 38 replies, 1 voice, and was last updated 3 years ago by Velociraptux.
-
-
05/20/2016 at 10:41 AM #7462
You are truly amazing Adolfo!
Thank you so much! You are a PRT wizard!
05/20/2016 at 10:48 AM #746505/20/2016 at 11:11 AM #7471Hi 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
05/20/2016 at 11:23 AM #747305/20/2016 at 12:16 PM #7511@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 :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051IF DAYOFWEEK=1 THEN // MondayMAXIMO = CashHighFrMINIMO = CashLowFrCashClose = DClose(1)IF TIME = 160000 THENCashHighMo = 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)ENDIFENDIFIF DAYOFWEEK=2 THENMAXIMO = CashHighMoMINIMO = CashLowMoCashClose = DClose(1)IF TIME = 160000 THENCashHighTu = Highest[x](high)CashLowTu = Lowest[x](low)ENDIFENDIfIF DAYOFWEEK=3 THENMAXIMO = CashHighTuMINIMO = CashLowTuCashClose = DClose(1)IF TIME = 160000 THENCashHighWe = Highest[x](high)CashLowWe = Lowest[x](low)ENDIFENDIFIF DAYOFWEEK=4 THENMAXIMO = CashHighWeMINIMO = CashLowWeCashClose = DClose(1)IF TIME = 160000 THENCashHighTh = Highest[x](high)CashLowTh = Lowest[x](low)ENDIFENDIFIF DAYOFWEEK=5 THENMAXIMO = CashHighThMINIMO = CashLowThCashClose = DClose(1)IF TIME = 160000 THENCashHighFr = Highest[x](high)CashLowFr = Lowest[x](low)ENDIFENDIFreturn 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)
1 user thanked author for this post.
05/20/2016 at 12:56 PM #7520Thanks 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?
05/20/2016 at 2:59 PM #7523Thank 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…..
05/20/2016 at 3:14 PM #7524Ok 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
ENDIFIF DAYOFWEEK=2 THEN
MAXIMO = CashHighMo
MINIMO = CashLowMo
CashClose = DClose(72)
IF TIME = 070000 THEN
CashHighTu = Highest[72](high)
CashLowTu = Lowest[72](low)
ENDIF
ENDIfIF DAYOFWEEK=3 THEN
MAXIMO = CashHighTu
MINIMO = CashLowTu
CashClose = DClose(72)
IF TIME = 070000 THEN
CashHighWe = Highest[72](high)
CashLowWe = Lowest[72](low)
ENDIF
ENDIFIF DAYOFWEEK=4 THEN
MAXIMO = CashHighWe
MINIMO = CashLowWe
CashClose = DClose(72)
IF TIME = 070000 THEN
CashHighTh = Highest[72](high)
CashLowTh = Lowest[72](low)
ENDIF
ENDIFIF DAYOFWEEK=5 THEN
MAXIMO = CashHighTh
MINIMO = CashLowTh
CashClose = DClose(72)
IF TIME = 070000 THEN
CashHighFr = Highest[72](high)
CashLowFr = Lowest[72](low)
ENDIF
ENDIFreturn MAXIMO AS “LAST DAY MAX”,MINIMO AS “LAST DAY LOW”,CashClose as “Cash Close”
05/20/2016 at 3:18 PM #752505/20/2016 at 3:24 PM #752605/20/2016 at 3:34 PM #7527I 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:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061REM ESTABLISH MAX AND MIN EACH DAY OF WEEKbase = 270periodo = 006000-horaanteriorn = abs(round(periodo/100))x = abs(round(base/n))IF TIME=010000 THENhoraanterior = Time[1]endifIF DAYOFWEEK=1 THENMAXIMO = CashHighFrMINIMO = CashLowFrCashClose = DClose(1)IF TIME = 170000 THENCashHighMo = Highest[x](high)CashLowMo = Lowest[x](low)ENDIFENDIFIF DAYOFWEEK=2 THENMAXIMO = CashHighMoMINIMO = CashLowMoCashClose = DClose(1)IF TIME = 170000 THENCashHighTu = Highest[x](high)CashLowTu = Lowest[x](low)ENDIFENDIfIF DAYOFWEEK=3 THENMAXIMO = CashHighTuMINIMO = CashLowTuCashClose = DClose(1)IF TIME = 170000 THENCashHighWe = Highest[x](high)CashLowWe = Lowest[x](low)ENDIFENDIFIF DAYOFWEEK=4 THENMAXIMO = CashHighWeMINIMO = CashLowWeCashClose = DClose(1)IF TIME = 170000 THENCashHighTh = Highest[x](high)CashLowTh = Lowest[x](low)ENDIFENDIFIF DAYOFWEEK=5 THENMAXIMO = CashHighThMINIMO = CashLowThCashClose = DClose(1)IF TIME = 170000 THENCashHighFr = Highest[x](high)CashLowFr = Lowest[x](low)ENDIFENDIFreturn MAXIMO AS "LAST DAY MAX",MINIMO AS "LAST DAY LOW",CashClose as "Cash Close"05/20/2016 at 8:36 PM #758505/21/2016 at 1:48 AM #7589Hi 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..
05/21/2016 at 2:32 AM #759005/21/2016 at 2:47 AM #7591
Gm Jeff!
If you want the close price at 16:30 to be printed the rest of the day, include this:
123If time=163000 thenMyclose = closeEndifVariable 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!
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on