Hi,
How does sessionlastbar toggle to TRUE in realtime trading? What does it check exactly?
If close time of session is 1320 and I have a 30min timeframe chart......On the first tick received after 1300, does sessionlastbar=true?
Or is it doing it retrospectively? Say on the first tick of the new session.... if I reload the chart, it will show the 1320 previous bar as TRUE?
I can see that if I load a historical chart, sessionlastbar will be True for the last bar of the session on a day with an early close. How does it know? Therefore it must be a retrospective query?
Thanks.
"Sessionlastbar" behaviour in realtime
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: "Sessionlastbar" behaviour in realtime
Hello wilkinsw,How does sessionlastbar toggle to TRUE in realtime trading? What does it check exactly?
SessionLastBar returns True on the last calculation of the study for the selected session.
No. If it is indeed a calculation on the last bar for the session then sessionlastbar=true will be on bar close (IOG=Off) or last tick of the bar (IOG=On).If close time of session is 1320 and I have a 30min timeframe chart......On the first tick received after 1300, does sessionlastbar=true?
New session is not related to this reserved word.Or is it doing it retrospectively? Say on the first tick of the new session.... if I reload the chart, it will show the 1320 previous bar as TRUE?
Re: "Sessionlastbar" behaviour in realtime
Hi Henry,
I think I may have run into an issue when using "sessionlastbar" to assign a value to a variable, when trading live.
How is it known when a tick is the "last tick" of the session? What is the exact logic please. Is it done on a timer, ie once time>=session end time + timer countdown?
Thanks.
I think I may have run into an issue when using "sessionlastbar" to assign a value to a variable, when trading live.
How is it known when a tick is the "last tick" of the session? What is the exact logic please. Is it done on a timer, ie once time>=session end time + timer countdown?
Thanks.
- Angelina MultiСharts
- Posts: 260
- Joined: 28 Dec 2016
- Has thanked: 28 times
- Been thanked: 66 times
Re: "Sessionlastbar" behaviour in realtime
Hello wilkinsw,
Here is how the tick is recognized as a "last tick" of the session:
1. If there are new ticks with a timestamp outside of session hours. In this case "sessionlastbar" is assigned to the bar straight away.
2. It there are no new ticks, formula time>=session end time + timer countdown is used, timer value is set in the Registry. "sessionlastbar" property is assigned to the bar after the timeout.
Here is how the tick is recognized as a "last tick" of the session:
1. If there are new ticks with a timestamp outside of session hours. In this case "sessionlastbar" is assigned to the bar straight away.
2. It there are no new ticks, formula time>=session end time + timer countdown is used, timer value is set in the Registry. "sessionlastbar" property is assigned to the bar after the timeout.