Made some changes in the code… Pasting the code below:-

```
//This exploration is made to scan stocks were the Beta > 1.1 and Stochastic Crossover
```

TimeFrameSet( inMonthly ); // switch to Monthly time frame

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(SL,“SLP”,1.2,colorBlack,colorPink);

AddColumn(FTP,“FTP”,1.2,colorBlack,colorPaleGreen);

AddColumn(STP,“STP”,1.2,colorBlack,colorPaleGreen);