Hi Everyone ,
i have given the AFL below , its a simple EMA crossover . i have got the buy/sell signals from this forum itself.
And i have helpfull to all who helped me .
Just require a exploration code i.e., i need a alert output when ever a buy/sell signal is generated.
Thank you in advance
the AFL is as below :
------------------------------------------------
SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("EMA");
Range1=Optimize("range1",14,1,20,1);
Range2=Optimize("range2",206,1,125,1);
Buy = Cross((EMA(Close,range1)),(EMA(Close,range2)));
Sell = Cross(EMA(Close,range2),(EMA(Close,range1)));
Short = Sell;
Cover = Buy;
// plot expanded average
Plot(EMA( Close,range1), "70min-ema", colorRed );
Plot(EMA( Close,range2), "1030min-ema", colorGreen );
// plot arrows
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );
_SECTION_END();
perc=Param("text up-dn,",1,0.5,2,0.1);
dist = ((H+L)/1)/90* perc;
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist, colorWhite, colorGreen );
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist, colorWhite, colorRed );
}
_SECTION_END();
-----------------------------------------------------------
i have given the AFL below , its a simple EMA crossover . i have got the buy/sell signals from this forum itself.
And i have helpfull to all who helped me .
Just require a exploration code i.e., i need a alert output when ever a buy/sell signal is generated.
Thank you in advance
the AFL is as below :
------------------------------------------------
SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("EMA");
Range1=Optimize("range1",14,1,20,1);
Range2=Optimize("range2",206,1,125,1);
Buy = Cross((EMA(Close,range1)),(EMA(Close,range2)));
Sell = Cross(EMA(Close,range2),(EMA(Close,range1)));
Short = Sell;
Cover = Buy;
// plot expanded average
Plot(EMA( Close,range1), "70min-ema", colorRed );
Plot(EMA( Close,range2), "1030min-ema", colorGreen );
// plot arrows
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );
_SECTION_END();
perc=Param("text up-dn,",1,0.5,2,0.1);
dist = ((H+L)/1)/90* perc;
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist, colorWhite, colorGreen );
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist, colorWhite, colorRed );
}
_SECTION_END();
-----------------------------------------------------------
Last edited: