Skip to main content

% Away from MA for Amibroker (AFL)

khanhmd almost 6 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 2)
  • Tags:
    amibroker

Ly thuyet Moving Avg: Khi gia chay xa duong trung binh, thi xu huong se keo no ve lai gan duogn trung binh do.

Plots a histogram of the distance of the price from the moving average.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("% Away from MA");

SetChartBkGradientFill( ParamColor("Top Color", colorWhite),ParamColor("Bottom Color", colorWhite));
periods = Param( "MA",200 , 5, 500, 1 );
ptram=100*(C-MA(C,periods))/MA(C,periods);

Title = EncodeColor(colorBlack)+ Name()+ " - " + Date()+ " - " + EncodeColor(colorIndigo)+ "% Away from MA("+periods+")"+ EncodeColor(colorBlack)+ " = "+ WriteVal(ptram,1.2);

Plot(ptram,"% Away from MA("+periods+")",colorIndigo , ParamStyle( "Style",  styleThick, maskHistogram ), 2 );
_SECTION_END();

1 comments

Leave Comment

Please login here to leave a comment.