Stage Analysis Video Training Course

How to create the Mansfield Relative Performance Indicator - Page

#31
(This post was last modified: 2017-12-17, 05:30 PM by kingsrook14.)

RE: How to create the Mansfield Relative Performance Indicator

I have coded this on Amibroker. Please let me know if there is something I need to improve on.

+++
_SECTION_BEGIN("MansfieldRelativePerformance");
/*
Mansfield Relative Performance indicator
The formula of this indicator is a bit more difficult than the regular Standard Relative Performance indicator:
Code:
MRP = (( RP(today) / sma(RP(today), n)) - 1 ) * 100
Where:
RP = Standard Relative Performance indicator (see above)
SMA = Simple moving average over n days.
n = 52 for weekly charts, and n = 200 on daily charts
*/

TimeFrameSet(inWeekly);
maPeriod = Param( "Weeks", 52, 0, 500, 1 );
rsSymbol = ParamStr( "Index Symbol", "NSENIFTY" ); //Change the symbol to your Index

rs = ( Close / Foreign( rsSymbol,"Close" ) );

RSC = 10*(( rs / MA( rs, maPeriod ) ) - 1);
TimeFrameRestore();

RscMansfield = TimeFrameExpand(Rsc,inWeekly,expandLast);
Plot( 0, "Line 0", colorBlue, styleLine);
Plot( RscMansfield,"RscMansfield",ParamColor( "Color", colorAqua ),1);
PlotOHLC(RscMansfield,RscMansfield,0,RscMansfield,"", IIf( RscMansfield > 0, ParamColor("Up Color", colorGreen ), ParamColor("Down Color", colorRed ) ),
styleCloud);
_SECTION_END();
+++

Reply


Messages In This Thread
RE: How to create the Mansfield Relative Performance Indicator - by kingsrook14 - 2017-12-17, 05:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)
//