Page 1 of 1

CurrentSession Function

Posted: Nov 03 2014
by rrams
Since updating to latest MC 9, build 10013, 32bit and starting this Sunday I could not get the CurrentSession function to return a value for QMZ4 or ZB Dec 14. Still works for NQZ4.

The return value for CurrentSession does not print -1 using NumToStr, so I don't know if it is even initialized properly. Maybe only works for positive integers?

Local or Exchange Time does not have an effect.

Re: CurrentSession Function

Posted: Nov 04 2014
by arnie
Since updating to latest MC 9, build 10013, 32bit and starting this Sunday I could not get the CurrentSession function to return a value for QMZ4 or ZB Dec 14. Still works for NQZ4.

The return value for CurrentSession does not print -1 using NumToStr, so I don't know if it is even initialized properly. Maybe only works for positive integers?

Local or Exchange Time does not have an effect.
US change their time this Sunday.
Are you using a custom session template?
Check your computer time settings.

When will we see all countries change their time at the same day so we don't have this time related issues?
Every year is the same, for a week or two everything gets off :(

Re: CurrentSession Function

Posted: Nov 04 2014
by bensat
When will we see all countries change their time at the same day so we don't have this time related issues? Every year is the same, for a week or two everything gets off :(
When we see no time adjustments at all ? Nobody needs it and everybody knows it.

Regards.

Ben

Re: CurrentSession Function

Posted: Nov 04 2014
by rrams
Thanks for the reply Arnie. I use the standard futures templates.

I forgot about the daylight savings time change. Arizona does not observe DST, so maybe there was an hour where the exchange fell back and this created a negative time difference in the CurrentSession function?

If that is the case: it seems to me that the CurrentSession function code could be fixed by simply changing line 34 from

var2 = MinutesIntoWeek( DayOfWeek( Date ), Time ) ;

to

var2 = MinutesIntoWeek( DayOfWeek( q_date ), q_time ) ;

Could someone verify? How do I unlock in the editor for making changes?

Re: CurrentSession Function

Posted: Nov 04 2014
by bensat
Could someone verify? How do I unlock in the editor for making changes?
CurrentSession can't be modified because it is a "BuildIn-Function". You have to copy the code and implement & verify it in a new function (pls find attached). Not tested.

Regards.

Ben

Re: CurrentSession Function

Posted: Nov 05 2014
by Henry MultiŠ”harts
Hello rrams,

Please send us (support@multicharts.com) the following information for further analysis:
- workspace you are using;
- in QuoteManager select the symbols you are using, make a right click on it->Export data->Export instrument (with data). Send us the QMD export file for analysis;
-in Power Language editor->File->Export->Export with dependent functions the study you are backtesting. Send us the study export file;
- attach a detailed description of the issue and highlight the incorrect values on the screenshots / in an output file.