Simple Question - Close at 1615pm on a 24 hours chart?

Questions about MultiCharts and user contributed studies.
tradinghumble
Posts: 38
Joined: 11 Jun 2006

Simple Question - Close at 1615pm on a 24 hours chart?

Postby tradinghumble » 12 Apr 2010

Hi, I have a simple question on how to retrieve the Close at 1615 (end of eMini session) on a 24 hours chart... lastly, I would need the open at 930am to test a gap fading strategy.

Any help / pointers would be greatly appreciated.

Thanks.

User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 12 Apr 2010

try this:


Code: Select all

var:
close1615(0);

if time = 1615 then close1615 = close;


User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 12 Apr 2010

press the [F1] key and check out these keywords:


Sess1EndTime
Sess1FirstBarTime
Sess1StartTime
Sess2EndTime
Sess2FirstBarTime
Sess2StartTime
SessionCount
SessionCountMS
SessionEndDay
SessionEndDayMS
SessionEndTime
SessionEndTimeMS
SessionLastBar
SessionStartDay
SessionStartDayMS
SessionStartTime
SessionStartTimeMS


tradinghumble
Posts: 38
Joined: 11 Jun 2006

Postby tradinghumble » 12 Apr 2010

Thanks TJ for the quick answer.

thutch
Posts: 52
Joined: 16 Sep 2011
Has thanked: 16 times
Been thanked: 10 times

Re:

Postby thutch » 05 Oct 2011

Hi TJ

I found this thread after posting on this other one first: viewtopic.php?f=1&t=7194

The example here is very close to my issue. I'm trying to find the close for prior sessions (but not just the last one). As I understand it, in your posted solution 'close1615' will be overwritten with each subsequent session's closing price. If this understanding is correct, do you know a way to reference not only the previous session's closing price but also the closing session price of the day before that?

many thanks

TJ wrote:try this:


Code: Select all

var:
close1615(0);

if time = 1615 then close1615 = close;


User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Re:

Postby TJ » 05 Oct 2011

thutch wrote:Hi TJ

I found this thread after posting on this other one first: viewtopic.php?f=1&t=7194

The example here is very close to my issue. I'm trying to find the close for prior sessions (but not just the last one). As I understand it, in your posted solution 'close1615' will be overwritten with each subsequent session's closing price. If this understanding is correct, do you know a way to reference not only the previous session's closing price but also the closing session price of the day before that?

many thanks

TJ wrote:try this:


Code: Select all

var:
close1615(0);

if time = 1615 then close1615 = close;



What instrument and chart resolution are you using?
Are you charting 24 hrs? or RTH?
What efforts have you attempted?

thutch
Posts: 52
Joined: 16 Sep 2011
Has thanked: 16 times
Been thanked: 10 times

Re: Re:

Postby thutch » 05 Oct 2011

TJ wrote:
thutch wrote:Hi TJ

I found this thread after posting on this other one first: viewtopic.php?f=1&t=7194

The example here is very close to my issue. I'm trying to find the close for prior sessions (but not just the last one). As I understand it, in your posted solution 'close1615' will be overwritten with each subsequent session's closing price. If this understanding is correct, do you know a way to reference not only the previous session's closing price but also the closing session price of the day before that?

many thanks

TJ wrote:try this:


Code: Select all

var:
close1615(0);

if time = 1615 then close1615 = close;



What instrument and chart resolution are you using?
Are you charting 24 hrs? or RTH?
What efforts have you attempted?


Its a crude oil future (CL on Nymex) which trades continuously from 18:00 ET to 17:15 ET the following day. I'm using a 1-minute bar resolution.

The difficulty I'm having is that closeD refers to the date close, not the session. Therefore I have been digging into ways to look-up (or record) the session close going back several days. Without success so far.

Hope that helps

User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Re:

Postby TJ » 05 Oct 2011

thutch wrote:...
Its a crude oil future (CL on Nymex) which trades continuously from 18:00 ET to 17:15 ET the following day. I'm using a 1-minute bar resolution.

The difficulty I'm having is that closeD refers to the date close, not the session. Therefore I have been digging into ways to look-up (or record) the session close going back several days. Without success so far.

Hope that helps

You can do the following:

1. add a second data series with the session ending 1615.

2. use this funtion on the second data:

CloseD(1) of data2


for more information on multi-data analysis, see post #4
viewtopic.php?f=16&t=6929

User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Simple Question - Close at 1615pm on a 24 hours chart?

Postby TJ » 05 Oct 2011

another method is to count the number of bars.

e.g. there are 24 x 60 = 1440 one minute bars in a day (assume 24 hr chart).

if you are at 10 bars since 1615, the the value of the close is C[10].

if you want to know the close of previous day,
the value is C[10+1440].
These users thanked the author TJ for the post (total 2):
JoshMthutch

thutch
Posts: 52
Joined: 16 Sep 2011
Has thanked: 16 times
Been thanked: 10 times

Re: Simple Question - Close at 1615pm on a 24 hours chart?

Postby thutch » 06 Oct 2011

Thanks TJ.

I need to think about this a bit. Its not bad, but not ideal either. The risk is you change the bar resolution and then it wouldn't work...

User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Simple Question - Close at 1615pm on a 24 hours chart?

Postby TJ » 06 Oct 2011

thutch wrote:Thanks TJ.

I need to think about this a bit. Its not bad, but not ideal either. The risk is you change the bar resolution and then it wouldn't work...

You can always make the bar number an input variable,
or, use BarInterval to make an automatic calculation.

User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Simple Question - Close at 1615pm on a 24 hours chart?

Postby TJ » 06 Oct 2011

Another method:

Use ARRAY to store the closing prices.


Return to “MultiCharts”