Dear Experts,
Have a look at the below code were the conditions are as follows:-
- Buy Condition = Beta > 1.1 and Stochk > StochD
- Stop Loss = Buy Condition price - (ATR * 2)
3 First Target Price = Buy Condition price + (ATR * 3)
4 Second Target Price = Buy Condition price + (ATR * 6)
//This exploration is made to scan stocks were the Beta > 1.1 and Stochastic Crossover
inDaily
ticker = ParamStr("Ticker","nsenifty");
P = Foreign(ticker,"C",1);
Periods = Param("period",7,1,50,1);
AT = ATR(7);
// Calculation of Beta
Beta = ((Periods * Sum(ROC(C,1) * ROC(P,1),Periods)) - (Sum(ROC(C,1),Periods) * Sum(ROC(P,1),Periods))) /
((Periods * Sum((ROC(P,1)^2),Periods)) - (Sum(ROC(P,1),Periods)^2));
//Condition for Buy
BC = Beta > 1.1 AND StochK(8,3) > StochD(8,3,3)
//Stop Loss
SL = BC - (AT * 2);
//Target Price
FTP = BC + (AT * 3);
STP = BC + (AT * 6);
Filter = BC;
AddColumn(C,"Close",1.2);
AddColumn(Beta,"Beta",1.2);
AddColumn(AT,"ATR",1.2);
AddColumn(BC,"Buy Price",1.2,colorBlack,colorGreen);
AddColumn(,"SLP",1.2,colorBlack,colorPink);//
AddColumn(FTP,"FTP",1.2,colorBlack,colorPaleGreen);
AddColumn(STP,"STP",1.2,colorBlack,colorPaleGreen);
There are lots of errors in the code...please kindly help to solve them.
Regards,
Sonjoe