Coding problem - Trix4Kids indicator.

 

Hi,

I'm trying to create EA based on the attached indictor. However I'm having difficulties to make simple rule that makes Buy when FastPeriod line changes from Red to Green and Sell when FastPeriod line changes from Green to Red. All transactions based on 1st shift.

Thanks in advance for help.

Regards

Files:
trix4kids2.mq4  13 kb
 

Hi WHRoeder,

I have used iCustom including below function and EA makes random trades.

string checkTrix2(string what)

{

double fastTrixR0 = iCustom(NULL, 0, "Trix4Kids2",20,30,false,false,false, 1, 1);

double fastTrixG0 = iCustom(NULL, 0, "Trix4Kids2",20,30,false,false,false, 0, 1);

double fastTrixR1 = iCustom(NULL, 0, "Trix4Kids2",20,30,false,false,false, 1, 2);

double fastTrixG1 = iCustom(NULL, 0, "Trix4Kids2",20,30,false,false,false, 0, 2);


if(what == "open")

{

string fastTrixC = "aa";


if(fastTrixR1 == fastTrixG1 && fastTrixG0 < 1 && fastTrixG0 > -1){

fastTrixC = "Buy";

}

if(fastTrixR1 == fastTrixG1 && fastTrixR0 < 1 && fastTrixR0 > -1){

fastTrixC = "Sell";

}

//Print(fastTrixC);

}

return(fastTrixC);


}

Regards

 
  1. Look at buffers 4 and 5. They contain the true state.

  2. For large amounts of code, attach it
Reason: