Required Help in writing afl for amibroker for automated trading

#1
HI There,

required help in creating the afl for amibroker Condition is:

3 day sma crosses from below yesetrday high = Buy
3 day sma crosses from above yesterday high=sell
3 day sma crosses from above yesetrday low = sell
3 day sma crosses from below yesetrday low = buy

Please help in creating the afl for amibroker for automated trading
 
#4
can you help in plotting buy sell short cover Arrows whenever (MA-3 crosses stochastic %D )in this attached afl
Can this help,

Code:
_SECTION_BEGIN("DoubleStochastic");
// Downloaded From www.WiseStockTrader.com
pds = 14; /*Periods */
/*pds = Optimize("pds",13,2,20,1); */
slw = 29; /*Slowing for Full Stoch%K*/
/*slw = Optimize("slw",3,1,14,1); */
slwd = 14; /*Slowing for Full Stoch%D*/
/*slwd = Optimize("slwd",3,1,14,1); */
ob = 85; /*Overbought */
/*ob = Optimize("ob",83,65,88,1); */
os = 15; /*Oversold */
/*os = Optimize("os",24,20,50,1); */

FSK = 100*(C-LLV(L,pds))/(HHV(H,pds)-LLV(L,pds)); // FASTSTOCHK

FLSK = EMA( FSK, slw ); // FULLSTOCHK

DSK = ((FLSK-LLV(FLSK,pds))/(HHV(FLSK,pds)-LLV(FLSK,pds))) * 100;

DLSK = EMA( DSK, slwd ); // FULLSTOCHD

Plot( MA( DLSK, 3 ), "MA-3"+_PARAM_VALUES(), ParamColor( "ColorD", colorRed ), styleDashed);
Plot( DLSK, "Stochastic %D"+_PARAM_VALUES(), ParamColor( "ColorK", colorBlue ));
Plot(Ob,"Overbought Level",colorRed, styleDashed);
Plot(Os,"Oversold Level",colorGreen, styleDashed);

MA3 = MA(DLSK,3);

Buy = Cross(DLSK,MA3);


Sell = Cross(MA3,DLSK);

Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell,Buy);

Plotshapes(Buy*shapeUpArrow,colorGreen,0,DLSK,-15,0);
Plotshapes(Sell*shapeDownArrow,colorRed,0,DLSK,-15,0);

_SECTION_END();
It will look like this:
StochArrows.jpg
 

ag82

New Member
#5
Can this help,

Code:
_SECTION_BEGIN("DoubleStochastic");
// Downloaded From www.WiseStockTrader.com
pds = 14; /*Periods */
/*pds = Optimize("pds",13,2,20,1); */
slw = 29; /*Slowing for Full Stoch%K*/
/*slw = Optimize("slw",3,1,14,1); */
slwd = 14; /*Slowing for Full Stoch%D*/
/*slwd = Optimize("slwd",3,1,14,1); */
ob = 85; /*Overbought */
/*ob = Optimize("ob",83,65,88,1); */
os = 15; /*Oversold */
/*os = Optimize("os",24,20,50,1); */

FSK = 100*(C-LLV(L,pds))/(HHV(H,pds)-LLV(L,pds)); // FASTSTOCHK

FLSK = EMA( FSK, slw ); // FULLSTOCHK

DSK = ((FLSK-LLV(FLSK,pds))/(HHV(FLSK,pds)-LLV(FLSK,pds))) * 100;

DLSK = EMA( DSK, slwd ); // FULLSTOCHD

Plot( MA( DLSK, 3 ), "MA-3"+_PARAM_VALUES(), ParamColor( "ColorD", colorRed ), styleDashed);
Plot( DLSK, "Stochastic %D"+_PARAM_VALUES(), ParamColor( "ColorK", colorBlue ));
Plot(Ob,"Overbought Level",colorRed, styleDashed);
Plot(Os,"Oversold Level",colorGreen, styleDashed);

MA3 = MA(DLSK,3);

Buy = Cross(DLSK,MA3);


Sell = Cross(MA3,DLSK);

Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell,Buy);

Plotshapes(Buy*shapeUpArrow,colorGreen,0,DLSK,-15,0);
Plotshapes(Sell*shapeDownArrow,colorRed,0,DLSK,-15,0);

_SECTION_END();
It will look like this:
View attachment 26601
thanks a lot
 

Similar threads

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?