Close Yesterday 17:00h
Forums › ProRealTime English forum › ProBuilder support › Close Yesterday 17:00h
- This topic has 15 replies, 6 voices, and was last updated 5 years ago by Nicolas.
-
-
03/10/2017 at 9:55 AM #28049
Hello guys I have a problem.
I want to show the close of the 1 minute candlestick yesterday at 17:00h in Probuilder.
My idea:
12345If yesterday and Time = 170000 Thenmyclose = closeEndifReturn mycloseBut “yesterday” or something like this dosn´t work.
Does somebody has any idea
03/10/2017 at 10:49 AM #28062It depends “from when” you want to display the 17h close of previous day…
If you want to display it from beginning of current day until close of current day, then this should do:
12345678if time=170000 thentempclose=closeendifif openday<>openday[1] thenmyclose=tempcloseendifreturn mycloseIf you want to display it from 17h previous day until 17h current day, then this other version should do it:
12345if time=170000 thenmyclose=closeendifreturn myclose03/10/2017 at 11:56 AM #2807710/17/2019 at 2:40 PM #11039610/17/2019 at 2:54 PM #11039810/17/2019 at 11:33 PM #11043710/17/2019 at 11:46 PM #110440Change the time to 000000 or anything else.
10/17/2019 at 11:51 PM #110441Or do you mean as in the example from before where the 1700 close is not shown until the start of a new day? If so this should do it:
1234567891011if time = 170000 thenmyclose2 = myclose1myclose1 = myclosemyclose = closeendifif openday <> openday[1] thenmyclosex = myclose2endifreturn myclosex10/17/2019 at 11:57 PM #11044210/18/2019 at 6:29 AM #110448That will be little bulky if I code like this:-
Look Back Day X - 17:001234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192Once EndTime = 170000Once LookBackDay = 5 // Range: 1-7If Time = EndTime thenIf LookBackDay = 1 thenTempClose1 = CloseEndIfIf LookBackDay = 2 thenTempClose2 = TempClose1TempClose1 = CloseEndIfIf LookBackDay = 3 thenTempClose3 = TempClose2TempClose2 = TempClose1TempClose1 = CloseEndIfIf LookBackDay = 4 thenTempClose4 = TempClose3TempClose3 = TempClose2TempClose2 = TempClose1TempClose1 = CloseEndIfIf LookBackDay = 5 thenTempClose5 = TempClose4TempClose4 = TempClose3TempClose3 = TempClose2TempClose2 = TempClose1TempClose1 = CloseEndIfIf LookBackDay = 6 thenTempClose6 = TempClose5TempClose5 = TempClose4TempClose4 = TempClose3TempClose3 = TempClose2TempClose2 = TempClose1TempClose1 = CloseEndIfIf LookBackDay = 7 thenTempClose7 = TempClose6TempClose6 = TempClose5TempClose5 = TempClose4TempClose4 = TempClose3TempClose3 = TempClose2TempClose2 = TempClose1TempClose1 = CloseEndIfEndifIf Openday <> Openday[1] thenIf LookBackDay = 1 thenCloseDX = TempClose1EndIfIf LookBackDay = 2 thenCloseDX = TempClose2EndIfIf LookBackDay = 3 thenCloseDX = TempClose3EndIfIf LookBackDay = 4 thenCloseDX = TempClose4EndIfIf LookBackDay = 5 thenCloseDX = TempClose5EndIfIf LookBackDay = 6 thenCloseDX = TempClose6EndIfIf LookBackDay = 7 thenCloseDX = TempClose7EndIfEndIfreturn CloseDX10/18/2019 at 9:44 AM #110463TODAY instruction has changed with v11, so now the only solution is to make a loop … Previously a simple solution would be to make simple substract: TODAY-DATE<=29 (it should still work in v10.3 though), you can test it with:
12345678once x = 29if today-date<=x thenif time=100000 thendrawhline(close)endifendifreturnNot tested, please do.
1 user thanked author for this post.
10/18/2019 at 9:50 AM #110464I came up with this:
1234567891011121314151617181920p = 29 //how many days ago you are looking for the close ofclosetime = 170000 //the close time that you are looking for p days agodisplaytime = 000000 //the time that you want to start displaying that close time froma = timeif barindex >= p and time = displaytime thentimecount = 0for j = 0 to barindexif a[j] = closetime thentimecount = timecount + 1if timecount = p thenmyclose = close[j]breakendifendifnextendifreturn myclose1 user thanked author for this post.
10/18/2019 at 1:34 PM #11050310/18/2019 at 2:23 PM #11050610/18/2019 at 2:25 PM #110507Mine is working too!!!
Perhaps BC did not apply it to the price chart. It is very messy compared to mine so I think mine still wins!
-
AuthorPosts
Find exclusive trading pro-tools on