Session high/low/close/open  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Session high/low/close/open

Postby MAtricks » 03 Jun 2014

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?

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

Re: Session high/low/close/open

Postby arnie » 03 Jun 2014

For RTH session templates you can use the functions openD, closeD, highD and lowD.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Session high/low/close/open

Postby MAtricks » 03 Jun 2014

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.

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: Session high/low/close/open

Postby TJ » 03 Jun 2014

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.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Session high/low/close/open

Postby MAtricks » 03 Jun 2014

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.
Last edited by MAtricks on 11 Jun 2014, edited 1 time in total.

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

Re: Session high/low/close/open

Postby arnie » 04 Jun 2014

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?

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Session high/low/close/open

Postby MAtricks » 04 Jun 2014

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.

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

Re: Session high/low/close/open

Postby arnie » 04 Jun 2014

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.

OZ Trade
Posts: 39
Joined: 08 Nov 2013
Has thanked: 11 times
Been thanked: 18 times

Re: Session high/low/close/open

Postby OZ Trade » 06 Jun 2014

I'll vote for any additional keywords that add more functionality to 'session' coding.. I use it a lot in my work

OZ Trade
Posts: 39
Joined: 08 Nov 2013
Has thanked: 11 times
Been thanked: 18 times

Re: Session high/low/close/open

Postby OZ Trade » 07 Jun 2014

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

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

Re: Session high/low/close/open

Postby Henry MultiСharts » 05 Sep 2014

We are going to add prebuilt functions for accessing Session high/low/close/open in MultiCharts 9.1 beta 1.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Session high/low/close/open

Postby MAtricks » 05 Sep 2014

:D Awesome news Henry!

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

Re: Session high/low/close/open  [SOLVED]

Postby Henry MultiСharts » 28 Jul 2015

Added new built-in functions for returning Session Open/High/Low/Close prices (openS, highS, lowS, closeS) in MultiCharts 9.1 Beta 1.

gztanwei
Posts: 32
Joined: 15 Aug 2015
Has thanked: 6 times
Been thanked: 5 times

Re: Session high/low/close/open

Postby gztanwei » 08 Oct 2015

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.
Attachments
Image 8.png
(9.87 KiB) Downloaded 4995 times

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: Session high/low/close/open

Postby TJ » 08 Oct 2015

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.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Session high/low/close/open

Postby MAtricks » 06 Nov 2015

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.

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

Re: Session high/low/close/open

Postby Henry MultiСharts » 10 Nov 2015

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.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Session high/low/close/open

Postby MAtricks » 10 Nov 2015

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.

Image

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") ;
Attachments
Session OHLC functions.wsp
(141.96 KiB) Downloaded 811 times
Session OHLC.pla
(5.62 KiB) Downloaded 801 times
Session OHLC functions.png
(170.53 KiB) Downloaded 5200 times

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

Re: Session high/low/close/open

Postby Henry MultiСharts » 12 Nov 2015

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.


Return to “MultiCharts”