Thursday, October 10, 2024

AFL CODE-DOUBLE PSYCHOLOGY INDEX

 

A_SECTION_BEGIN("Double PsychIndex");

LookBack1= Param("Number of lookback periods 1",7, 2, 100);

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

UThreshold= Param("Upper threshold (%)",70, 0, 100);

LThreshold= Param("Lower threshold (%)", 30,0, 100);

UpDay= Close > Ref(Close,-1);

PsychIndex1= 100*Sum(UpDay,LookBack1) / LookBack1;

PsychIndex2= 100*Sum(UpDay,LookBack2) / LookBack2;

Plot(PsychIndex1,"PsychIndex ("+Lookback1+")",ParamColor("Color1",colorRed), ParamStyle("Style1",styleLine));

Plot(PsychIndex2,"PsychIndex ("+Lookback2+")",ParamColor("Color2",colorlightOrange), ParamStyle("Style2",styleLine));

Plot(UThreshold,"+UThreshold+",colorGrey40,styleDashed|styleNoTitle); 

Plot(LThreshold,"+LThreshold+",colorGrey40,styleDashed|styleNoTitle);

_SECTION_END();

👉Tải tại đây

https://drive.google.com/file/d/1GWGaImn-gZ316KYADpvsDBN3tbk5XWmo/view?usp=drive_link

Cách sử dụng AFL  cho Amibroker  

Tải xuống tệp Amibroker AFL. 

Bây giờ hãy sao chép tệp afl và dán vào vị trí cài Amibroker  

D:\A KY PC\Win\Amibroker\Formulas\VIP free


1 comment: