Psychological Index

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

//------------------------------------------------------------------------------

// Formula Name : Psychological index AFL FOR AMIBROKER


// Origin : Modified & Collected from different sources.
//------------------------------------------------------------------------------

_SECTION_BEGIN("PSY Index");
GfxSetBkMode(1);
X=750;
Y=1;
Font=10;
GfxSelectFont("Impact",Font*2.2, 550);GfxSetTextColor(colorRed);GfxTextOut("KrT
group",x,y);
GfxSelectFont("Impact",Font*2.2,
550);GfxSetTextColor(colorGreen);GfxTextOut("RESEARCH",x+120,Y);

_SECTION_END();

//------------------------------------------------------------------------------

_SECTION_BEGIN("EOD PsychIndex");

LookBack= Param("Number of lookback periods",12, 2, 100);


UThreshold= Param("Upper threshold (%)",75, 0, 100);
LThreshold= Param("Lower threshold (%)", 25,0, 100);
UpDay= Close > Ref(Close,-1);
PsychIndex= 100*Sum(UpDay,LookBack) / LookBack;
Plot(PsychIndex,_DEFAULT_NAME(),ParamColor("Color",colorRed),
ParamStyle("Style",styleLine));
Plot(UThreshold,"75",colorBlack,styleDashed|styleNoTitle);
Plot(LThreshold,"25",colorBlack,styleDashed|styleNoTitle);
_SECTION_END();

You might also like