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);
Returning open price current bar -Multi-Data Reference
-
- Posts: 275
- Joined: 22 Apr 2014
- Has thanked: 70 times
- Been thanked: 72 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Returning open price current bar -Multi-Data Reference
See post #5Hi, 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);
viewtopic.php?f=16&t=6929
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
-
- Posts: 275
- Joined: 22 Apr 2014
- Has thanked: 70 times
- Been thanked: 72 times
Re: Returning open price current bar -Multi-Data Reference
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
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
- Attachments
-
- eurusdh1.png
- (54.39 KiB) Downloaded 489 times
- 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
Hello Alex, did you find a solution for current value in data2 ?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