Working with data series - close of dataX

Questions about MultiCharts and user contributed studies.
HummerH1
Posts: 66
Joined: 13 Sep 2011
Has thanked: 6 times
Been thanked: 1 time

Working with data series - close of dataX

Postby HummerH1 » 29 Jan 2012

Hello,
I have a chart, with 2 data series:
Same instrument : s&p
Same session : CME Globex Combined
One 15 mins resolution : Data1
One 1 Day resolution : Data3

Now, I've created an indicator with the code below:

Code: Select all

[IntrabarOrderGeneration = true]
variables: MovingAverage200( 0 ),MovingAverage( 0 );
if barstatus(3)=2 then
begin
MovingAverage200= Average( Close of data3, 200) ;
MovingAverage= Average( Close of data1, 200) ;

print("in Day "+ Text(Date of data3," ",Time of data3," close-1= ",Close[1] of data3," close= ",close of data3," "));
print("in 15M "+ Text(Date of data1," ",Time of data1," close-1= ",Close[1] of data1," close= ",close of data1," "));
print("in 15M "+ Text(time of data1," ",time[1] of data1));
print("in Day "+ Text(time of data3," ",time[1] of data3));
end;


Why don't I get the same value for Close of data1 and Close of data3?

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

Re: Working with data series - close of dataX

Postby TJ » 29 Jan 2012

Hello,
...

Why don't I get the same value for Close of data1 and Close of data3?
Short answer:

Ask your data provider why don't they provide the same value.


Long answer:

Minute charts closes its bar at the end of the minute.

Daily charts closes the bar at the end of the session. But the exchange does not publish the official closing price at the exact closing time. It is published usually a few minutes after the close. (ie. at a different time than the minute bar close.)

When you load a historic chart, you might see a discrepancy in the quote: minute chart carries the closing price at the time of the minute bar's close, while the daily chart would carry the "official closing price" of the day.
In real time, after the day's close, but before the official daily close is published, you might even momentarily "lose" the daily bar.

HummerH1
Posts: 66
Joined: 13 Sep 2011
Has thanked: 6 times
Been thanked: 1 time

Re: Working with data series - close of dataX

Postby HummerH1 » 29 Jan 2012

Ok thanks for the longer answer :)
My data provider is esignal. But I did not know the closing price of the daily bar was adjusted retroactively.

The exchange is closing in my case at 15.15 untill 15.30.

So I wanted to check if the first tick of the 15.30 to 15.45 bar might be equal to the close of the daily bar.

I tried this code:

Code: Select all

if time of data1 > 1515 and time[1] of data1=1515 and barstatus(1) = 0 then
begin
print("in 15M "+ Text(Date of data1," ",Time of data1," close-1= ",Close[1] of data1," close= ",close of data1," "));
print("in 15M "+ Text(time of data1," ",time[1] of data1, "barstatus=",barstatus(1)));
end;
But the condition "barstatus(1) = 0" is never true. I can get the closing tick price, but not the opening tick price.

In the indicator propertied I have checked "update on every tick" and unchecked "skip identical ticks"

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Working with data series - close of dataX

Postby Dave Masalov » 03 Feb 2012

Why don't I get the same value for Close of data1 and Close of data3?
HummerH1,

eSignal provides both real-time minute and real-time daily data. Different Minute and daily data close values may come from the data provider. Please check it in eSignal software and if the values are the same there contact eSignal with this question.

HummerH1
Posts: 66
Joined: 13 Sep 2011
Has thanked: 6 times
Been thanked: 1 time

Re: Working with data series - close of dataX

Postby HummerH1 » 03 Feb 2012

Hello Dave,
TJ already gave me an answer to this (Thanks TJ!).

The problem I still have is the one of post#3

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

Re: Working with data series - close of dataX

Postby Henry MultiСharts » 07 Feb 2012

The described behaviour has not been reproduced in our environment.
The condition "barstatus(1) = 0" is true using the provided script.
Please come to our live chat Monday-Friday 6:30 am - 11 am EST to investigate this query with the specialist in this field.
We will do our best to help you.


Return to “MultiCharts”