Page 1 of 1
Session high/low/close/open
Posted: Jun 03 2014
by MAtricks
We have the DailyClose, DailyHigh, DailyLow, DailyOpen, and DailyVolume as reserved words.
Would it make sense to also have a SessionClose, SessionHigh, SessionLow, SessionOpen, and SessionVolume since we tend to make our calculations on session open to session close instead of midnight to midnight?
Or is there a simple trick to isolate these values?
Re: Session high/low/close/open
Posted: Jun 03 2014
by arnie
For RTH session templates you can use the functions openD, closeD, highD and lowD.
Re: Session high/low/close/open
Posted: Jun 03 2014
by MAtricks
Thanks.
Yes the reserved daily words would work if you only use the Regular trading session hours, but I don't... As it is, I need to screw around with code to isolate the inside of a session.
I was hoping that MC had some trick for me seeing as they plot the Session Breaks on each window.
Re: Session high/low/close/open
Posted: Jun 03 2014
by TJ
Thanks.
Yes the reserved daily words would work if you only use the Regular trading session hours, but I don't... As it is, I need to screw around with code to isolate the inside of a session.
I was hoping that MC had some trick for me seeing as they plot the Session Breaks on each window.
Read carefully Arnie's post... those are
not reserved words.
ie you can modify the code to suite your need.
Re: Session high/low/close/open
Posted: Jun 03 2014
by MAtricks
TJ,
I'm not using Regular Trading Hour Templates and the suggested functions reset at the next day (midnight). Hence the start of this thread.
I apologize. HighD, LowD..CloseD are functions not reserved words.
Its not perfect, but this is my workaround:
Code: Select all
Variables:
SessionOpen( 0 ),
SessionHi( 0 ),
SessionLo( 0 ) ;
If Time=SessionStartTime(0,1)+Barinterval then begin
SessionOpen=O[1] ;
SessionHi=H[1] ;
SessionLo=L[1] ;
end else
If Time>SessionStartTime(0,1)+Barinterval or Time<SessionEndTime(0,1) then begin
if H>SessionHi then SessionHi=H ;
if L<SessionLo then SessionLo=L ;
end ;
//Edited to add in +barinterval to start the timer correctly
I vote for the addition of SessionHigh, SessionLow, SessionOpen, SessionClose to our reserved words.
Re: Session high/low/close/open
Posted: Jun 04 2014
by arnie
Indeed, the openD, highD, lowD and closeD can only work with RTH templates. If one want to use a 24h session template (for the ES I use 1700 to 1615) you really need to do some coding so you can have a correct reading since you are grabing data from previous day (prior midnight) and today's data to find the values you want.
One would imagine that a simple thing as calling a session high would be in fact simple.
ABC coded for me a couple of years ago a study that does exactly that.
In my case, it's based on time paramaters where I can select the time I want and I get the high, low, close, open or whatever calculations I want to based on that time. So if I want to have a session that started yesterday at 1300 and ends today at 1515 I'll have the data perfectly calculated.
Since I wanted to retrieve the RTH session within my 24h session, the time imputs were key.
Again, it's time based and not session template based.
For a more basic reading, yes, it would be very welcomed keywords or even functions that could recognize the time template used.
Here's a thought, since CurrentSession function is able to recognize the session template used, is there a way to merge it with the openD and the other functions so they could also recognize the session template?
Re: Session high/low/close/open
Posted: Jun 04 2014
by MAtricks
My above code can do that as well.. Just change the start/end time to an input format:
Code: Select all
Inputs:
StartTime( 1800 ),
EndTime( 1715 ) ;
Variables:
SessionOpen( 0 ),
SessionHi( 0 ),
SessionLo( 0 ) ;
If Time=StartTime then begin
SessionOpen=O[1] ;
SessionHi=H[1] ;
SessionLo=L[1] ;
end else
If Time>StartTime or Time<EndTime then begin
if H>SessionHi then SessionHi=H ;
if L<SessionLo then SessionLo=L ;
end ;
I don't see anyway to convert HighD, LowD, and OpenD to using sessions... HighD = DailyHigh.. However, the provided code here could be perfected and turned into a function.
I guess my point is to ask the question of why we have multiple ways to identify the features of a Day and very little for a session.
Re: Session high/low/close/open
Posted: Jun 04 2014
by arnie
I guess my point is to ask the question of why we have multiple ways to identify the features of a Day and very little for a session.
Simple, equities trading has been the realm for retail traders and the "Day" keywords and functions was sufficient to retrieve the data needed.
Only when retail traders started to embrace futures things start to change. Since futures trade almost 24h a day, the "Day" keywords started to not deliver the data needed.
Unfortunately, most platforms did not updated their platform to futures trading, leaving up to the traders that task.
Although the ability to build session templates help a lot in creating the sessions we want, keywords and functions were not updated to take advantage of the session templates.
Again, that task was left to the traders, or in this case, programmers to find ways to code what they need with the available keywords. Needless to say that traders without any type of programming skill are left alone, without any type of help, resulting obviously in moving away to another platform that is capable of offering the tools he need.
Re: Session high/low/close/open
Posted: Jun 06 2014
by OZ Trade
I'll vote for any additional keywords that add more functionality to 'session' coding.. I use it a lot in my work
Re: Session high/low/close/open
Posted: Jun 07 2014
by OZ Trade
And it would be great if the proposed SessionClose for intraday futures charts actually returned the settled daily closing price for past session which have completed..
Provided that it's the same symbol in QuoteManager and the daily data is up to date for that symbol.. could it be possible?
Currently I am having to write/retrieve settled daily closes to/from txt files
Re: Session high/low/close/open
Posted: Sep 05 2014
by Henry MultiСharts
We are going to add prebuilt functions for accessing Session high/low/close/open in MultiCharts 9.1 beta 1.
Re: Session high/low/close/open
Posted: Sep 05 2014
by MAtricks
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Awesome news Henry!
Re: Session high/low/close/open [SOLVED]
Posted: Jul 28 2015
by Henry MultiСharts
Added new built-in functions for returning Session Open/High/Low/Close prices (openS, highS, lowS, closeS) in MultiCharts 9.1 Beta 1.
Re: Session high/low/close/open
Posted: Oct 08 2015
by gztanwei
Added new built-in functions for returning Session Open/High/Low/Close prices (openS, highS, lowS, closeS) in MultiCharts 9.1 Beta 1.
What about OpenD and CloseD? Are they day open and day close? How are they different from OpenS and CloseS?
Could I request engineer team to add sufficient description to reference? As in the attached pic, it does not have any description in reference.
Thanks.
Re: Session high/low/close/open
Posted: Oct 08 2015
by TJ
Added new built-in functions for returning Session Open/High/Low/Close prices (openS, highS, lowS, closeS) in MultiCharts 9.1 Beta 1.
What about OpenD and CloseD? Are they day open and day close? How are they different from OpenS and CloseS?
Could I request engineer team to add sufficient description to reference? As in the attached pic, it does not have any description in reference.
Thanks.
OpenD and CloseD are based on changing DATE.
OpenS and CloseS are based on changing SESSION.
The EasyLanguage Functions & Reserved Words Reference is a complete reference listing of every EasyLanguage reserved word and EasyLanguage function. This comprehensive guide gives complete descriptions, usages, input declarations, and code examples for each EasyLanguage syntax element.
Additional Information Sources.
Re: Session high/low/close/open
Posted: Nov 06 2015
by MAtricks
These are great to have so thank you.
I'm having an issue.. HighS, LowS, CloseS, and OpenS do not work on tick based charts. Any thoughts? I have a Point bar chart up and the calculation is done from the beginning of the chart to the end.
Re: Session high/low/close/open
Posted: Nov 10 2015
by Henry MultiСharts
These are great to have so thank you.
I'm having an issue.. HighS, LowS, CloseS, and OpenS do not work on tick based charts. Any thoughts? I have a Point bar chart up and the calculation is done from the beginning of the chart to the end.
Hello MAtricks,
These functions work ok on our end. Please make sure you have at least one session break on your chart.
Re: Session high/low/close/open
Posted: Nov 10 2015
by MAtricks
These are identical charts. Both go back 30 days on the ES. There's obviously a scaling issue, but more importantly, the calculation is done only once on the Point Bar chart.
Code: Select all
INPUTS:
PeriodsAgo( 1 ) ;
VARIABLES:
Cs( 0 ),
Os( 0 ),
Hs( 0 ),
Ls( 0 ) ;
Cs = OpenS(PeriodsAgo) ;
Os = CloseS(PeriodsAgo) ;
Hs = HighS(PeriodsAgo) ;
Ls = LowS(PeriodsAgo) ;
Plot1( Cs, "SessionClose" ) ;
Plot2( Os, "SessionOpen" ) ;
Plot3( Hs, "SessionHi") ;
Plot4( Ls, "SessionLo") ;
Re: Session high/low/close/open
Posted: Nov 12 2015
by Henry MultiСharts
These are identical charts. Both go back 30 days on the ES. There's obviously a scaling issue, but more importantly, the calculation is done only once on the Point Bar chart.
Code: Select all
INPUTS:
PeriodsAgo( 1 ) ;
VARIABLES:
Cs( 0 ),
Os( 0 ),
Hs( 0 ),
Ls( 0 ) ;
Cs = OpenS(PeriodsAgo) ;
Os = CloseS(PeriodsAgo) ;
Hs = HighS(PeriodsAgo) ;
Ls = LowS(PeriodsAgo) ;
Plot1( Cs, "SessionClose" ) ;
Plot2( Os, "SessionOpen" ) ;
Plot3( Hs, "SessionHi") ;
Plot4( Ls, "SessionLo") ;
Hello MAtricks,
These functions can work only on Ticks & Contracts, Seconds, Minutes, & Hours, Days, Weeks, Months, Quarters, & Years resolutions.