Kuriose Leerzeichen in DateTime-Darstellung
Forums › ProRealTime Deutsch forum › ProBuilder Support › Kuriose Leerzeichen in DateTime-Darstellung
- This topic has 0 replies, 1 voice, and was last updated 3 years ago by Rainer (RFW).
-
-
10/21/2021 at 1:23 PM #180079
Guten Tag liebe PRTler,
im Zusammenhang mit Datum/Zeit-Funktionen werden merkwürdiger Weise überflüssige Leerzeichen nach den Daten zurückgegeben, was leider zu einer unschönen Darstellung führt, Jahreszahlen gar mit Tausender-Trennzeichen, siehe Screenshot.
Insofern musste ich zur ordentlichen Ausgabe entsprechend modifizieren, siehe weiteren Screenshot.
Interessieren würde mich, ob es eine einfachere Möglichkeit der klaren Ausgabe gäbe. Oder habe ich grundsätzliches falsch gemacht?
Zur Problem-Verdeutlichung nachfolgend der Code, bzw. itf-Datei anbei. Mit DisplayMod (0=unmodifiziert/1 modifiziert) kann dies nachgestellt werden.
Vielen Dank vorab und liebe Grüße
RainerDateTime Modifizierung123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125// Rainer (RFW) @ prorealcode.com//********************************************************************************************************************************************************************Defparam Drawonlastbaronly = True//********************************************************************************************************************************************************************If StartDate = 0 ThenStartDate = Date[2]EndIfIf StartTime = 0 ThenStartTime = 020000EndIfIf EndDate = 0 ThenEndDate = Date[1]EndIfIf EndTime = 0 ThenEndTime = 220000EndIf//********************************************************************************************************************************************************************If IsLastBarupdate ThenLookBack = BarIndex//********************************************************************************************************************************************************************For StartDateTimeSearchFx = LookBack DownTo 1 DoIf (Date[StartDateTimeSearchFx] = StartDate) And (Time[StartDateTimeSearchFx] = StartTime) ThenStartBarID = BarIndex[StartDateTimeSearchFx]StartLB = StartDateTimeSearchFxStartDay = Day[StartDateTimeSearchFx]StartMonth = CurrentMonth[StartDateTimeSearchFx]StartYear = CurrentYear[StartDateTimeSearchFx]StartHour = CurrentHour[StartDateTimeSearchFx]StartMinute = CurrentMinute[StartDateTimeSearchFx]BreakEndIfNext//********************************************************************************************************************************************************************If (StartBarID > 0) ThenFor EndDateTimeSearchFx = StartDateTimeSearchFx DownTo 1 DoIf (Date[EndDateTimeSearchFx] = EndDate) And (Time[EndDateTimeSearchFx] = EndTime) ThenEndBarID = BarIndex[EndDateTimeSearchFx]EndLB = EndDateTimeSearchFxEndDay = Day[EndDateTimeSearchFx]EndMonth = CurrentMonth[EndDateTimeSearchFx]EndYear = CurrentYear[EndDateTimeSearchFx]EndHour = CurrentHour[EndDateTimeSearchFx]EndMinute = CurrentMinute[EndDateTimeSearchFx]BreakEndIfNextEndIf//********************************************************************************************************************************************************************If (StartBarID > 0) And (EndBarID > 0) ThenDRAWVLINE(StartBarID)Coloured(0,0,222)Style(Line,3)DRAWVLINE(EndBarID)Coloured(0,0,222)Style(Line,3)For ActiveFx = StartLB DownTo EndLB DoDRAWVLINE(Barindex[ActiveFx])Coloured(0,0,222,75)Style(Line,1)//********************************************************************************************************************************************************************//********************************************************************************************************************************************************************// Code.......//********************************************************************************************************************************************************************//********************************************************************************************************************************************************************Next//*****************************************************************************************************************************************************************************************************************************************ADHFx = 1+((TextDistance)/10000)AULFx = 1-((TextDistance)/10000)TXTD = ((LineDistance+3)/10000)TKV = 10ITXV = 20+TKVITXV1 = 10+TKVITXV2 = 30+TKVHiLoTxtP = Round(LookBack/3)InfoPos = (Highest[HiLoTxtP](High)+Lowest[HiLoTxtP](Low))/2InfoTxTFx0 = ADHFx-TXTDInfoTxTFx1 = ADHFx-(TXTD*0.5)InfoTxTFx2 = ADHFx-(TXTD*1.5)InfoTxTFx3 = ADHFx-(TXTD*2.0)InfoTxTFx4 = ADHFx-(TXTD*2.5)InfoTxTFx5 = ADHFx-(TXTD*3.0)InfoTxTFx6 = ADHFx-(TXTD*3.5)InfoTxTFx7 = ADHFx-(TXTD*4.0)InfoTxTFx8 = ADHFx-(TXTD*4.5)InfoTxTFx9 = ADHFx-(TXTD*5.0)InfoTxTFx10 = ADHFx-(TXTD*5.5)InfoTxTFx11 = ADHFx-(TXTD*6.0)InfoTxTFx12 = ADHFx-(TXTD*6.5)InfoTxTFx13 = ADHFx-(TXTD*7.0)InfoTxTFx14 = ADHFx-(TXTD*7.5)InfoTxTFx15 = ADHFx-(TXTD*8.0)InfoTxTFx16 = ADHFx-(TXTD*8.5)InfoTxTFx17 = ADHFx-(TXTD*9.0)InfoTxTFx18 = ADHFx-(TXTD*9.5)InfoTxTFx19 = ADHFx-(TXTD*10.0)InfoTxTFx20 = ADHFx-(TXTD*10.5)//*****************************************************************************************************************************************************************************************************************************************If DisplayMod = 0 ThenDrawText("Start: #StartDay#.#StartMonth#.#StartYear# - #StartHour#:0#StartMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx0,Dialog,Bold,16)DrawText("End: #EndDay#.#EndMonth#.#EndYear# - #EndHour#:#EndMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx1,Dialog,Bold,16)ElsIf DisplayMod = 1 ThenStartYear = StartYear-2000EndYear = EndYear-2000If (StartHour < 10) And (StartMinute < 10) ThenDrawText("Start: #StartDay#. #StartMonth#. #StartYear#- 0#StartHour#: 0#StartMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx0,Dialog,Bold,16)ElsIf (StartHour < 10) And (StartMinute >= 10) ThenDrawText("Start: #StartDay#. #StartMonth#. #StartYear#- 0#StartHour#: #StartMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx0,Dialog,Bold,16)ElsIf (StartHour >= 10) And (StartMinute < 10) ThenDrawText("Start: #StartDay#. #StartMonth#. #StartYear#- #StartHour#: 0#StartMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx0,Dialog,Bold,16)ElsIf (StartHour >= 10) And (StartMinute >= 10) ThenDrawText("Start: #StartDay#. #StartMonth#. #StartYear#- #StartHour#: #StartMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx0,Dialog,Bold,16)EndIfIf (EndHour < 10) And (EndMinute < 10) ThenDrawText("End: #EndDay#. #EndMonth#. #EndYear#- 0#EndHour#: 0#EndMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx1,Dialog,Bold,16)ElsIf (EndHour < 10) And (EndMinute >= 10) ThenDrawText("End: #EndDay#. #EndMonth#. #EndYear#- 0#EndHour#: #EndMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx1,Dialog,Bold,16)ElsIf (EndHour >= 10) And (EndMinute < 10) ThenDrawText("End: #EndDay#. #EndMonth#. #EndYear#- #EndHour#: 0#EndMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx1,Dialog,Bold,16)ElsIf (EndHour >= 10) And (EndMinute >= 10) ThenDrawText("End: #EndDay#. #EndMonth#. #EndYear#- #EndHour#: #EndMinute# Uhr",BarIndex+ITXV,InfoPos*InfoTxTFx1,Dialog,Bold,16)EndifEndif // DisplayMod//*****************************************************************************************************************************************************************************************************************************************EndIf // CodeDateTime//*****************************************************************************************************************************************************************************************************************************************EndIf // IsLastBarupdate//*****************************************************************************************************************************************************************************************************************************************Return -
AuthorPosts
Find exclusive trading pro-tools on