AFL for RSI Crossing above 45 & below 55

#25
HTML:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C,
1 )) ));
Plot(C,"",1,128);
b =Optimize("Buy Trigger",Param("Buy Trigger",45,5,65,1),5,65,1);
s=Optimize("Sell Trigger",Param("Sell Trigger",55,1,40,1),1,90,1);
SetPositionSize( 50, spsShares ); // 50 shares by default

Buy=Cross(RSI(),b);
Sell=Cross(s,RSI());

//Buy=ExRem(Buy,Sell);
//Sell=ExRem(Sell,Buy);
shape = Buy * shapeUpArrow +Sell * shapeDownArrow ;

PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );

enjoy
hi I am new to this group. I have been using AFL for my daily trading and I am full-time trader. i am using the above logic since a long time but i have more combinations to make the signals more robust. for ex: my buy is Buy = (Cross(TII,signalLine) AND TII >30 AND (BRSI) AND RVBuy AND ADXBuy) OR (Trendup AND BRSI); where I have used my own variables. the results are amazing on all segment whether it is crude or banknifty or nifty .And of course RSI periods 14 helps a lot and for any segment except stocks stick to 15min. Great results. Can you help me to understand where can i change the periods to 14 if i want to?
I am requesting for small help. Inline with the above code, I would want it to check if Relative Vigor Index (periods 8) has done the cross over before it gives the buy or sell. This will help in reentry and avoid false signals.
 

Similar threads