CurrentSession Function

Questions about MultiCharts and user contributed studies.
User avatar
rrams
Posts: 128
Joined: 10 Feb 2011
Location: USA
Has thanked: 7 times
Been thanked: 70 times
Contact:

CurrentSession Function

Postby rrams » 03 Nov 2014

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.

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: CurrentSession Function

Postby arnie » 04 Nov 2014

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 :(

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: CurrentSession Function

Postby bensat » 04 Nov 2014

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

User avatar
rrams
Posts: 128
Joined: 10 Feb 2011
Location: USA
Has thanked: 7 times
Been thanked: 70 times
Contact:

Re: CurrentSession Function

Postby rrams » 04 Nov 2014

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?

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: CurrentSession Function

Postby bensat » 04 Nov 2014

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
Attachments
CurrentSession_mod.pla
(4.1 KiB) Downloaded 416 times

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

Re: CurrentSession Function

Postby Henry MultiСharts » 05 Nov 2014

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.


Return to “MultiCharts”