Hi,
I am trying to create a system that uses 2 data series and uses IOG.
i.e 10 minute (data1) and 5 minute (data2).
My signal will calculate values, based on a formula, at every tick on the 10 minute bar.
What I would like to do is be able to store the value at every TICK for the entire duration of the 10 minute bar and also be able to access the data mainly for this purpose - to see what the last TICK's value was on the close of the last 5 minute bar.
I think I would only need a rolling 2 bar history. Therefore, data that is older than 2 bars would be reset (expire).
I think what I'm looking for is an array with a loop.
Cheers
Champski
Using an array with 2 data series
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
Re: Using an array with 2 data series
Without getting into too much detail here, I always thought it was preferred, from a programming perspective, that you have data1 be the shorter time period (5 min) and data2 be the longer time period (10 min). You can also always recreate the data from a 10 minute period bar using 5 minute period bar data, so you may not even need to have two data streams.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Using an array with 2 data series
how many cells do you think you would need for this array?Hi,
I am trying to create a system that uses 2 data series and uses IOG.
i.e 10 minute (data1) and 5 minute (data2).
My signal will calculate values, based on a formula, at every tick on the 10 minute bar.
What I would like to do is be able to store the value at every TICK for the entire duration of the 10 minute bar and also be able to access the data mainly for this purpose - to see what the last TICK's value was on the close of the last 5 minute bar.
I think I would only need a rolling 2 bar history. Therefore, data that is older than 2 bars would be reset (expire).
I think what I'm looking for is an array with a loop.
Cheers
Champski
Re: Using an array with 2 data series
Hi TJ,
I'm not really sure what you mean by "how many cells do you think you would need for this array?". I would like to store info at every tick then reference it later.
Cheers
Champski
I'm not really sure what you mean by "how many cells do you think you would need for this array?". I would like to store info at every tick then reference it later.
Cheers
Champski
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Using an array with 2 data series
this image might help:Hi TJ,
I'm not really sure what you mean by "how many cells do you think you would need for this array?". I would like to store info at every tick then reference it later.
Cheers
Champski
Re: Using an array with 2 data series
TJ,
I'm assuming the exact number of cells can not be predetermined as the number of ticks per bar will vary from one bar to another. (I think this means it needs to be a dynamic array???)
At every TICK (of the lower timeframe bar) I would like to be able to reference 1. the current close and 2. the current value of 'myvariable'. Therefore, I'm assuming the array would need 2 columns and an infinite number of rows per bar.
(NB. The value of 'Myvariable' changes every tick.)
I would then like to look back to a previous bar on a lower time frame and extract info such as;
1. tell me the value of 'myvariable' x number of ticks before the close of that bar.
2. tell me the average of 'myvariable' for the last x number of ticks before the close of that bar.
The idea behind the array is that it will give info with greater depth than just referencing the value of the last bar's close like this ;
Hi furytrader, thanks for your reply. I agree with what you are saying but I am having troubles creating my strategy by using the lower timeframe as the primary and am trying to create a workaround.
I'm assuming the exact number of cells can not be predetermined as the number of ticks per bar will vary from one bar to another. (I think this means it needs to be a dynamic array???)
At every TICK (of the lower timeframe bar) I would like to be able to reference 1. the current close and 2. the current value of 'myvariable'. Therefore, I'm assuming the array would need 2 columns and an infinite number of rows per bar.
(NB. The value of 'Myvariable' changes every tick.)
I would then like to look back to a previous bar on a lower time frame and extract info such as;
1. tell me the value of 'myvariable' x number of ticks before the close of that bar.
2. tell me the average of 'myvariable' for the last x number of ticks before the close of that bar.
The idea behind the array is that it will give info with greater depth than just referencing the value of the last bar's close like this ;
Code: Select all
intrabarordergeneration = true
var: intrabarpersist myvariable(0)
myvariable = (close data2 - close[1] data2) * .5
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Using an array with 2 data series
dynamic array can only have ONE column.TJ,
I'm assuming the exact number of cells can not be predetermined as the number of ticks per bar will vary from one bar to another. (I think this means it needs to be a dynamic array???)
At every TICK (of the lower timeframe bar) I would like to be able to reference 1. the current close and 2. the current value of 'myvariable'. Therefore, I'm assuming the array would need 2 columns and an infinite number of rows per bar.
(NB. The value of 'Myvariable' changes every tick.)
I would then like to look back to a previous bar on a lower time frame and extract info such as;
1. tell me the value of 'myvariable' x number of ticks before the close of that bar.
2. tell me the average of 'myvariable' for the last x number of ticks before the close of that bar.
The idea behind the array is that it will give info with greater depth than just referencing the value of the last bar's close like this ;Hi furytrader, thanks for your reply. I agree with what you are saying but I am having troubles creating my strategy by using the lower timeframe as the primary and am trying to create a workaround.Code: Select all
intrabarordergeneration = true
var: intrabarpersist myvariable(0)
myvariable = (close data2 - close[1] data2) * .5
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Using an array with 2 data series
EasyLanguage Essentials Programmers GuideIf I'm limited to one column I would like that column to include the values for 'myvariable' at every tick.
How can I do it?
Dynamic Arrays.... pg 42
EasyLanguage Reference Guide
CHAPTER 2 - The Basic EasyLanguage Elements
Understanding Arrays.... pg 41
https://www.multicharts.com/multicharts ... mentation/