How to Array Auto Fill?
-
Hi,
I tried to fill array automatically. But I can't do this.
I want to record with array for example every 10 seconds bid price into last 10 minutes.I created this array (10 minutes = 60 piece 10 seconds): varbid[60]
1)Once Per Second Blok : 10
2)Custom MQL Blok:for(int a=0; a<60;a++)
{
varbid[a]=MarketInfo(Symbol(),MODE_BID);
}I want to see difirance between varbid[60]- varbid[59] and varbid[59]-varbid[58] and so on....
how can I do this?
Thans for your help
-
this will put the current bid price into every index of the array.
put this into the custom mql code block:
for(int a=59;a>0;a--) { varbid[a]=varbid[a-1]; } varbid[0]=MarketInfo(Symbol(),MODE_BID);0 is the most recent price so 1 would be the second most recent and so on. 59 being the oldest.