I would like to know when the session begins and ends
if session end i use sessionlastbar..
But if session begin what i code it?
I see documentation and i see sessionStartTime
Should i use SessionStartTime?
if yes, i dont understand what is the parameter i use in
What is : SessionNum - a numerical expression specifying the Session Number
i need this session, i don't need to know the break time in the session but The Start And The End of Session..
I hope you can help me..thanks
Begin session and EndSession
- rrams
- Posts: 128
- Joined: 10 Feb 2011
- Location: USA
- Has thanked: 7 times
- Been thanked: 70 times
- Contact:
Re: Begin session and EndSession
Hello turbofib. Session times can be tricky to program so that the outcome is exactly the way you expect; but the code syntax is straight forward.
Session Numbers are pre-assigned in the Symbol Dictionary for each time-block a security trades during the week. Some instruments have just one number per day and trade Monday through Friday. Some futures start with Session Number one on Sunday and have two more sessions on Monday.
To get the SessionStartTime of the current bar you would need to use one of the built-in functions that returns the current session you are in as a parameter to the SessionStartTime function. The pre-built function CurrSessionNum(SessionType) returns that number or zero if you are currently between sessions during a break. You can just use 0=Auto Detect for Session Type so:
SessionStartTime(0, CurrSessionNum(0)) would return the start time in 24 hour format.
None of the Multicharts session number functions take into account differences in Daylight Saving Time; so if you are in a time zone that does not observe DST and the Exchange is currently on DST, then the function can return an incorrect result.
Session Numbers are pre-assigned in the Symbol Dictionary for each time-block a security trades during the week. Some instruments have just one number per day and trade Monday through Friday. Some futures start with Session Number one on Sunday and have two more sessions on Monday.
To get the SessionStartTime of the current bar you would need to use one of the built-in functions that returns the current session you are in as a parameter to the SessionStartTime function. The pre-built function CurrSessionNum(SessionType) returns that number or zero if you are currently between sessions during a break. You can just use 0=Auto Detect for Session Type so:
SessionStartTime(0, CurrSessionNum(0)) would return the start time in 24 hour format.
None of the Multicharts session number functions take into account differences in Daylight Saving Time; so if you are in a time zone that does not observe DST and the Exchange is currently on DST, then the function can return an incorrect result.
- rrams
- Posts: 128
- Joined: 10 Feb 2011
- Location: USA
- Has thanked: 7 times
- Been thanked: 70 times
- Contact:
Re: Begin session and EndSession
Because that would be trivial code. Once you know SessionLastBar, the begining of the next session would be the next bar.
Other people have gone through the learning process and contributed to this discussion before. viewtopic.php?t=10647 You are doing fine.
Other people have gone through the learning process and contributed to this discussion before. viewtopic.php?t=10647 You are doing fine.