DATE statement returns WRONG VALUE in MONTHLY Timeframe
Forums › ProRealTime English forum › ProRealTime platform support › DATE statement returns WRONG VALUE in MONTHLY Timeframe
- This topic has 9 replies, 4 voices, and was last updated 3 years ago by Nicolas.
-
-
02/16/2021 at 10:43 PM #161725
since a few days 2021/02/16 DATE statement returns wrong value in MONTHLY Timeframe.
DAY statements must return the last day of the candle (timeframe Weekly the date of friday, in Monthly the date of the last working day of the month).
but its’ a few day that DAY statement returns random date in monthly statement, sometime first date of the month, sometime first day of the next month, sometime the right date.02/16/2021 at 11:02 PM #161729DATE returns the date when the candle closes (OpenMonth when it opens, instead).
So when the monthly candle closes it returns:
- the first day of the new month if it’s a trading day
- the current date if the next day is NOT a trading day
- the current date LIVE
You can add this indicator to your Monthly chart to spot differences:
1return date AS "Date",opendate AS "OpenDate"02/17/2021 at 9:38 AM #161764Good Morning RobertoGozzi,
I don’t agree with you, we use DATE in indicator since a year, an DATE always returned the very last working day of the candle.
DATE change his behavior, it’s a few day, we noticed it yesterday, thatIn my opinion, the behaviour you write is not rational: for example, a MONTHLY candle for Ita 40 MIB november 2020, close at 17.30 on the evening of 2020/11/30, not on 2020/12/01.
we expect that in this scenario, DATE returns 2020/11/30, CLOSE return the fixing value registered at close auction end at 17:30 on 2020/11/30 (and in opposition, OPENDATE retursn 2020/11/02 first working date for november and OPEN returns the open value registered at 9:00 on 2020/11/02).
I attach an image that show wrong values returned (see image that show errors and incosistencies) and the simple code use to show it.
CODE THAT SHOW WRONG BEHAVIOR1234567891011workdate = datemesegiorno = workdate mod 10000drawtext("MMGG:#mesegiorno#" ,barindex,low-100)e = OpenDayk = OpenMonthdrawtext("OpenDay:#e# OpenMonth:#k#",barindex,high+100)return
02/17/2021 at 9:57 AM #16176902/17/2021 at 10:05 AM #161770MIB does NOT closes at 17:30.
It’s IG’s CFD, you can trade it continuously. it’s the broker’s decision when trading stops and when a candle closes.
02/17/2021 at 10:07 AM #161771Ok, sorry, I did not know that.
02/17/2021 at 10:54 AM #161784Indeed, this date problem exists but only with a short list of instruments. It is about to be fixed.
@Nicolas: i have found this date issue in a lof of instruments, not a few.
@RobertoGozzi: INDEX ITA official market, that i use to example, is open MON-FRY from 9:00 AM to 5:30 PM.
We USE NOT IG DATA, BUT OFFICIAL DATA. OFFICIAL DATA IS OFFICIAL DATA.@all: i expect that all of us agree that CLOSE DATE, in official data market, MUST IS the date-time of the last exchange on official market, not the date of next working date!
in my example, candle of n0vember 2020 time frame monthly, DATE MUST return “20201130” and CLOSE MUST return the official close rate of the instrument at 20201130 at 17:30 (if the official market close at 17:30), as is been for a long time.
02/17/2021 at 10:58 AM #16178602/17/2021 at 11:03 AM #161788Yes I should not have used “short” but “limited” 🙂
It is about some index Futures and NYSE shares, as far as i know.
European markets (index and share) too.
Do you have a time to fix it?
Do you know a workaround to discover the last working day in a month, while PRT resolve issue?02/17/2021 at 11:21 AM #161798Last day of the month snippets:
https://www.prorealcode.com/topic/tomorrows-date/#post-94725
https://www.prorealcode.com/topic/coding-help/#post-46525
-
AuthorPosts
Find exclusive trading pro-tools on