I need help translating a simple system of a few (12) lines into mql4.

 

Hi, it's a stop and reverse system, the moving average on the TR True range must be calculated: (high-low).

+ ------------------------------------------------- -------------------------------------------------- ------------- +

Input: Lenght (1), numARTs (0.2);
var: atrs, upper, lower, trueran;
AllowEnterAfterExit (false);// you only have to do one operation for each bar


trueran = h - l; // = atr (c, periodatr);


atrs = mov (trueran, Length, s) * numARTs;(moving average)


upper = close + atrs;
lower = close - atrs;


  enterlong (nextbar, upper, stop);

  entershort (nextbar, lower, stop);

PlotChart(upper,0,blue,solid,1);

PlotChart(lower,0,red,solid,1);


++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++ 

Thanks for your cooperation. If anyone is available I can also pay.

 

Do not double post!

I have deleted your duplicate topic.

Reason: