Help with iCustom in an EA

 

I am trying to use a custom indicator in my EA and am not sure how exactly to do so.


I am using Gravity Center2, a COG custom indicator. It has 3 external options which I have added to the iCustom but when I try to test the EA in the strategy tester it gets to about 50% on the progress bar and hangs there.


This code should check if the bars open price is below the custom indicators Level 6. Note that the indicator has 7 buffers, 0-6.... 5 is level 6.

double COG_L6=iCustom(Symb,Trade_Period,"Gravity Center2",Number_Of_Bars,Order,Ecart,5,0);

double Current_Open=iOpen(Symb,Trade_Period,0)


if(Current_Open < COG_L6){

Print("Bar Opened Below COG Level 6.");

}

Reason: