Chicago, IL
Posts: 6 since Oct 2015
Thanks Given: 0
Thanks Received: 3
|
As an alternative to using the daily data as data2, you can eliminate data2 and build an array from your 1 minute bars using the closed(x), opend(x), highd(x), lowd(x), etc functions. This will eliminate the need to load 2000 days back of bars and also saves the need to have Data2 in your data feed.
I can do something like:
array:
ClosedDay[100](0),
OpenDay[100](0);
if currentsession(1) <> current session(1)[1] then begin
for x = 100 downto 2
ClosedDay[x] = ClosedDay[x-1]
OpenDay[x] = ClosedDay[x-1]
end;
ClosedDay[1] = closed(1)
OpenDay[1] = opend(1)
Now all of the daily data is contained in the array 100 days back, or 15 in your case. Easy Language has a battery of array functions that allow you to perform many of the common functions on arrays such as:
MvgAvg = AveragrArray(ClosedDay, 30);
|