Problem with Incorporating MBFX system in an EA

 
Hi fellows,

I'm currently experiencing an issue for 2 days with an EA that use MBFX system and candles to trade. I don't have a high level on programing with mql4, so I took "OpenTiks" from the CodeBase as base for my EA. Perhaps i missed some codes that were in the original EA and that could explain the problem but i don't know. Actually i have 2 problems :

1) The EA doesn't seem to get values from MBFX system on backtest. I used iCustom for each of the 7 buffers of the indicator as follow :

double        var1           = iCustom(NULL,0,"MBFX_System_1",120,3,1.61803399,1,0);
double        var2           = iCustom(NULL,0,"MBFX_System_1",120,3,1.61803399,2,0);
double        var3           = iCustom(NULL,0,"MBFX_System_1",120,3,1.61803399,3,0);
double        var4           = iCustom(NULL,0,"MBFX_System_1",120,3,1.61803399,4,0);
double        var5           = iCustom(NULL,0,"MBFX_System_1",120,3,1.61803399,5,0);
double        var6           = iCustom(NULL,0,"MBFX_System_1",120,3,1.61803399,6,0);
double        var7           = iCustom(NULL,0,"MBFX_System_1",120,3,1.61803399,7,0);


2) The EA doesn't open Sell trades but only Buy orders. I used this one code to configurate :

bool BuyOp=false;
bool SellOp=false;

if (Close[2]<var6&&Close[2]>var7&&High[2]<High[1]&&Close[2]<Close[1]&&High[1]<(var6+0.5*(var5-var6))) BuyOp=true;
if (Close[2]<var4&&Close[2]>var3&&Low[2]>Low[1]&&Close[2]>Close[1]&&Low[1]>(var3-0.5*(var3-var2)))   SellOp=true;




I've attached the indicator under the name "MBFX_System_1", the other is the EA. Well maybe it will sound easy for some of you but s mentioned previously i am not a great coder, not yet at least. So if you guys have some suggestions to make, i'd highly appreciate them. Thank you in advance.

Files:
 

Perceval Safakhah: 1) The EA doesn't seem to get values from MBFX system on backtest. I used iCustom for each of the 7 buffers of the indicator as follow :

That isn't what your code does. If there are 7 buffers their indexes are [0 … 6]
          Detailed explanation of iCustom - MQL4 programming forum