Hi There
I have used several generic EA templates and tried referencing iCustom, but the EA doesn't trade even though it compiles ok and the indicator itself generates "trade signals".
I think I'm referencing iCustom incorrectly. Inputs are appreciated.
I'm trying to reference two values from the indicator Complex_Pairs1.
One is the signalline (SetIndexBuffer 0), the other one is the moving average of the signalline (SetIndexBuffer 1).
The indicator has two external parameters:
SignalType (for type of signal in case of an indicator crossover)
periodSMA (the period of the simple moving average)
I have pasted the relevant part of the sourcecode below.
Using iCustom I try to access 4 different values - the signalline and the SMA at bar 1 and bar 2, and I'm using this code:
double SignallineShift1 = iCustom(NULL,NULL,"Complex_Pairs1",2,0,0,1);
double SmaShift1 = iCustom(NULL,NULL,"Complex_Pairs1",2,4,1,1);
double SignallineShift2 = iCustom(NULL,NULL,"Complex_Pairs1",2,0,0,2);
double SmaShift2 = iCustom(NULL,NULL,"Complex_Pairs1",2,4,1,2);
Am I referencing the indicator values correctly? iCustom(symbol, timeframe, indicator name, SignalType, periodSMA, IndexBuffer, Shift). Or should I maybe omit signaltype and periodsma for the signal line, and signalType for the SMA?
Cheers
Tomas
___________________________________________________
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_width2 1
//---- buffers
double pair[],ma[];
//----
extern int SignalType=2;
extern int periodSMA=4;
SetIndexStyle(0, DRAW_LINE);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(0, pair);
SetIndexBuffer(1, ma);
I have used several generic EA templates and tried referencing iCustom, but the EA doesn't trade even though it compiles ok and the indicator itself generates "trade signals".
I think I'm referencing iCustom incorrectly. Inputs are appreciated.
I'm trying to reference two values from the indicator Complex_Pairs1.
One is the signalline (SetIndexBuffer 0), the other one is the moving average of the signalline (SetIndexBuffer 1).
The indicator has two external parameters:
SignalType (for type of signal in case of an indicator crossover)
periodSMA (the period of the simple moving average)
I have pasted the relevant part of the sourcecode below.
Using iCustom I try to access 4 different values - the signalline and the SMA at bar 1 and bar 2, and I'm using this code:
double SignallineShift1 = iCustom(NULL,NULL,"Complex_Pairs1",2,0,0,1);
double SmaShift1 = iCustom(NULL,NULL,"Complex_Pairs1",2,4,1,1);
double SignallineShift2 = iCustom(NULL,NULL,"Complex_Pairs1",2,0,0,2);
double SmaShift2 = iCustom(NULL,NULL,"Complex_Pairs1",2,4,1,2);
Am I referencing the indicator values correctly? iCustom(symbol, timeframe, indicator name, SignalType, periodSMA, IndexBuffer, Shift). Or should I maybe omit signaltype and periodsma for the signal line, and signalType for the SMA?
Cheers
Tomas
___________________________________________________
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_width2 1
//---- buffers
double pair[],ma[];
//----
extern int SignalType=2;
extern int periodSMA=4;
SetIndexStyle(0, DRAW_LINE);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(0, pair);
SetIndexBuffer(1, ma);