Need help .. Jus want to add *BUY* signal on this AFL

#1
Please add buy signal on the below afl when value is less than or equal to -60 and sell if value is more than or equal to 60 Thanks in Advance



_SECTION_BEGIN("Stochastic Momentum");
LookBack = Param("Lookback", 13, 2, 100 );
Smooth1 = Param("Smooth 1", 25, 1, 100 );
Smooth2 = Param("Smooth 2", 2, 1, 100 );

HH = HHV( H, LookBack );
LL = LLV( L, LookBack );

StoMom = 100 * EMA( EMA( C - 0.5 * ( HH + LL ), Smooth1 ), Smooth2 ) /
( 0.5 * EMA( EMA( HH - LL, Smooth1 ), Smooth2 ) );

Plot(StoMom, _DEFAULT_NAME(), ParamColor("Color", ColorCycle ) );
_SECTION_END();

 
Last edited:

NTrader42

Well-Known Member
#2
Please add buy signal on the below afl when value is less than or equal to -60 and sell if value is more than or equal to 60 Thanks in Advance

Its not a good idea to trade this signal, buy/sell arrows plotted for you to verify on your own

Cheers

Code:
_SECTION_BEGIN("Stochastic Momentum");
LookBack = Param("Lookback", 13, 2, 100 );
Smooth1 = Param("Smooth 1", 25, 1, 100 );
Smooth2 = Param("Smooth 2", 2, 1, 100 );

HH = HHV( H, LookBack );
LL = LLV( L, LookBack );

StoMom = 100 * EMA( EMA( C - 0.5 * ( HH + LL ), Smooth1 ), Smooth2 ) / 
( 0.5 * EMA( EMA( HH - LL, Smooth1 ), Smooth2 ) );

Plot(StoMom, _DEFAULT_NAME(), ParamColor("Color", ColorCycle ) );
_SECTION_END();

_SECTION_BEGIN("Stochastic Momentum Buy Sell");

Buy 	= StoMom <= -60;
Sell 	= StoMom >= 60;
Buy 	= 	ExRem(Buy,Sell);
Sell	=	ExRem(Sell,Buy);

PlotShapes(shapeUpArrow*Buy, colorGreen, 0, StoMom);
PlotShapes(shapeDownArrow*Sell, colorRed, 0, StoMom);
_SECTION_END();
 

Similar threads