Returning open price current bar -Multi-Data Reference

Questions about MultiCharts and user contributed studies.
hughesfleming
Posts: 275
Joined: 22 Apr 2014
Has thanked: 70 times
Been thanked: 72 times

Returning open price current bar -Multi-Data Reference

Postby hughesfleming » 16 Jun 2014

Hi, I need a little help to understand this,

I have a 60 minute and a daily time series on one chart.

PriceData1 = (Open of Data1); returns the open of the current bar on the 60 minute chart.
PriceData2 = (Open of Data2); returns yesterdays open price and not today's.

How do I return the open price of today's daily bar?

Many thanks,

Alex

Edit: If I am not mistaken, this code should return the same number.

var: DailyOpen(0, data2);
DailyOpen = Open Data2;

print(OpenD(0):0:5, " " , DailyOpen:0:5);

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

Re: Returning open price current bar -Multi-Data Reference

Postby TJ » 16 Jun 2014

Hi, I need a little help to understand this,
I have a 60 minute and a daily time series on one chart.
PriceData1 = (Open of Data1); returns the open of the current bar on the 60 minute chart.
PriceData2 = (Open of Data2); returns yesterdays open price and not today's.
How do I return the open price of today's daily bar?
Many thanks,
Alex
Edit: If I am not mistaken, this code should return the same number.
var: DailyOpen(0, data2);
DailyOpen = Open Data2;
print(OpenD(0):0:5, " " , DailyOpen:0:5);
See post #5
viewtopic.php?f=16&t=6929

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

Re: Returning open price current bar -Multi-Data Reference

Postby TJ » 16 Jun 2014

ps.
[FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713

hughesfleming
Posts: 275
Joined: 22 Apr 2014
Has thanked: 70 times
Been thanked: 72 times

Re: Returning open price current bar -Multi-Data Reference

Postby hughesfleming » 17 Jun 2014

Thanks for the tips on posting code TJ,

I figured out how to reference data2 properly so that part works. The problem is still how to get the current bar open when I call data2. I am getting the open of the previous bar not the current bar.

I am converting code from MT and I am trying to get the values as close as possible. The EL version is shifted to the right by one day because the calculation is not including todays open price.

The code in my first post should in my mind return the same number. It doesn't and I am trying to figure out why. I will do it in C# on the .net version to see if I can get it to work the way I want.

Kind regards,

Alex
MultiCharts3.png
(72.34 KiB) Downloaded 492 times
Attachments
eurusdh1.png
(54.39 KiB) Downloaded 489 times

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

Re: Returning open price current bar -Multi-Data Reference

Postby Henry MultiСharts » 24 Jun 2014

Hello Alex,

Please make sure the Realtime-History Matching is configured properly.

enricog
Posts: 11
Joined: 10 Dec 2021
Has thanked: 1 time

Re: Returning open price current bar -Multi-Data Reference

Postby enricog » 02 Mar 2022

Thanks for the tips on posting code TJ,

I figured out how to reference data2 properly so that part works. The problem is still how to get the current bar open when I call data2. I am getting the open of the previous bar not the current bar.

I am converting code from MT and I am trying to get the values as close as possible. The EL version is shifted to the right by one day because the calculation is not including todays open price.

The code in my first post should in my mind return the same number. It doesn't and I am trying to figure out why. I will do it in C# on the .net version to see if I can get it to work the way I want.

Kind regards,

Alex

MultiCharts3.png
Hello Alex, did you find a solution for current value in data2 ?


Return to “MultiCharts”