Download MetaTrader 5
To add comments, please log in or register
Have you found an error in our products? Apply to Service Desk!
Ming Luo
293
Ming Luo 2015.07.09 14:28 

Hi :

It is possible to define a variable that contains a value for every bar and this variable is not set as an indicator. 

 

In another word, this is a kind of dynamic array and I want to store some data other than the indicator values.

 

Thanks 

whroeder1
13602
whroeder1 2015.07.09 19:34  
static datetime time=0;
static double someData[];
int iAdd = iBarShift(NULL,0, time0); time0 = Time[0];
if(iAdd != 0){
   bool     isSeries = ArrayGetAsSeries(deque);
   ArraySetAsSeries(deque, !isSeries);  // This enlarges the array
   ArrayResize(someData, Bars);         // and shifts values 
   ArraySetAsSeries(deque, isSeries);   // B[2]=B[1]; B[1]=B[0]; B[0]=tbd
}
for(; iAdd >= 0; --iAdd){   someData[iAdd] = ... }
/
To add comments, please log in or register