Strange DateTime Issue..

Questions about MultiCharts and user contributed studies.
KhaosTrader
Posts: 186
Joined: 10 May 2012
Has thanked: 14 times
Been thanked: 11 times

Strange DateTime Issue..

Postby KhaosTrader » 30 Oct 2014

Hello,

I am having a weird issue.. Here are the appropriate code snippets:

Variables Declaired:

Code: Select all

LastSwingHiDate(DateTime),
LastSwingHiTime(DateTime),
LastSwingHiDateTimeComplete(DateTime),
Variable Values Assigned:

Code: Select all

if barstatus = 2 then begin
LastSwingHiPrice = ( lastHi ) ;
lastSwingHiBar = ( lastHiBar);

LastSwingHiDateTimeComplete = (Date[CurrentBar - lastHiBar]) + ( Time[CurrentBar - lastHiBar]);

LastSwingHiDate= (Date[CurrentBar - lastHiBar]);
LastSwingHiTime= (Time[CurrentBar - lastHiBar]);
end;
Variable Values outputted:

Code: Select all

print (

" Date: " + formatdate("dd-MM-yy", el_datetodatetime(LastSwingHiDateTimeComplete)) +
" Time: " + FormatTime("HH:mm", el_timetodatetime(LastSwingHiDateTimeComplete)) +
" T: " + FormatTime("HH:mm", el_timetodatetime(LastSwingHiTime)) +
" D: " + formatdate("dd-MM-yy", el_datetodatetime(LastSwingHiDate)) +

" Bar : " + (NumToStr(lastSwingHiBar,0)) +
" Price " + (NumToStr(LastSwingHiPrice,2))
);

Results:

Date: 28-09-14 Time: 20:59 T: 10:30 D: 29-10-14 Bar : 1393 Price 76.33
Date: 28-09-14 Time: 20:59 T: 10:30 D: 29-10-14 Bar : 1393 Price 76.33
Date: 28-09-14 Time: 20:59 T: 10:30 D: 29-10-14 Bar : 1393 Price 76.33
Date: 28-09-14 Time: 20:59 T: 10:30 D: 29-10-14 Bar : 1393 Price 76.33


Question: Why is date and Time of value 1 less? its incorrect. It should be time value of 10:30 and date value of 29-10-14.

Thanks.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Strange DateTime Issue..

Postby Henry MultiСharts » 30 Oct 2014

Hello KhaosTrader,

Please send us the following information to support@multicharts.com:
- workspace you are using;
- in QuoteManager select the symbol you are using, make a right click on it->Export data->Export instrument (with data). Send us the Qmd export file for analysis;
- in PowerLanguage editor->File->Export->export with dependent functions the studies you are using in the workspaces you are providing. Send us the study export file.
- what exact version and build number of MultiCharts are you running? (in MultiCharts go to Help tab-> About)
- attach a detailed problem description and highlight the problem on the screenshots


Return to “MultiCharts”