I am new to MQL4 programming.
Now I'm trying to use the indicator Hull variation 2
I'm trying the code below but it does not work opens in the wrong direction
double Hull_Up = iCustom(NULL,0,"Hull variation 2", HMAPeriod,HMAPrice,HMADivisor,0,0);; //Uptrend of Previous Bar Blue Up
double Hull_Dn = iCustom(NULL,0,"Hull variation 2", HMAPeriod,HMAPrice,HMADivisor,0,1); //Dntrend of Previous Bar Red Down
// Buy and Sell Open
if(Digits==3 || Digits==5) MyPoint=Point*10;
if(TotalOrdersCount()==0 && AllowTradesByTime()==True)
if(Hull_Up > Hull_Dn) // Here is your open buy rule
if(Hull_Up < Hull_Dn) // Here is your open Sell rule
In the EA Hull_Variation_RB_EA.mq4 attached the order is opening only once after it is closed does not open a new one.
Many orders open in the right direction indicator but are negative and lose a lot of money.
Attached SLOPE EA that has the same problem and does not close the orders by the indicator.
Could anyone help me to improve this EA?