Is it possible to import the buffer of a "Market" indicator ?

 

Hello, I want to use the data of a market indicator for an expert advisor, is it possible without the source file of the indicator ?

 
yes you can use icustom function .
 

Thanks, here is my code, it works, but I can not get the previous value, only the last. An idea ?

double DemandArray[];
static int DemandDefinition = iCustom(NULL,PERIOD_D1,"Market\\MT5",8,0,0,1,0,0,0,0);  
CopyBuffer(DemandDefinition,0,0,1,DemandArray);
double myDemandValue=DemandArray[0];
 
stanlotrading:

Thanks, here is my code, it works, but I can not get the previous value, only the last. An idea ?

CopyBuffer(DemandDefinition,0,0,2,DemandArray);
DemandArray[0] // value on current bar
DemandArray[1] // value on last closed bar
 
Nitin Raj:

Wrong, an array is not indexed as a serie by default.

DemandArray[0 1] // value on current bar
DemandArray[1 0] // value on last closed bar
 
Alain Verleyen:

Wrong, an array is not indexed as a serie by default.

oh yes, thanks for correcting. The array should be set as a series first. 

 
Thank You