Dear Sir,
I am new to AFL and trying to learn. Pl. any friend can help to correct this AFL.The mistake is starting from // EMA line.
Regards.
nms
_SECTION_BEGIN("EMA3 + EMA15 Cross");
EMA5_LineShow = ParamToggle("EMA3 Line", "Hide|Show",1);
EMA15_LineShow = ParamToggle("EMA15 Line", "Hide|Show",1);
CrossArrow_EMA3EMA15 = ParamToggle("CrossArrow-EMA3+EMA15", "Hide|Show",1);
EMA3LineColor = ParamColor("EMA3 Color", colorRose);
EMA15LineColor = ParamColor("EMA15 Color", colorTeal);
BuyTextColor = ParamColor("Buy Text", colorBrightGreen);
SellTextColor = ParamColor("Sell Text", colorRed);
SellTextBgr = ParamColor("Sell Text Bg", colorYellow);
BuyEMA3EMA15 = ParamColor("Buy Arrow", colorBrightGreen);
SellEMA3EMA15 = ParamColor("Sell Arrow", colorLightYellow);
//EMA Line
if(EMA3EMA15 == 0 || EMA3_LineShow == 0) {
Plot(EMA(Close,3),"EMA3 Line",EMA3LineColor, styleLine);
}
if(EMA3EMA15 == 0 || EMA30_LineShow == 0) {
Plot(EMA(Close,15),"EMA15 Line",EMA15LineColor, styleLine);
}
//CrossArrow_EMA3_EMA15
if(EMA3EMA15 == 0 || CrossArrow_EMA3EMA15 == 0) {
Buy=Cross(EMA(Close,3), EMA(Close,15));
Sell=Cross(EMA(Close,15), EMA(Close,3));
dist = 1.5*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist, BuyTextColor );
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist, SellTextColor, SellTextBgr );
}
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, BuyEMA3EMA15, SellEMA3EMA15 ), 0, IIf( Buy, Low, High ), -30 );
GraphXSpace = 10;
}
_SECTION_END();
I am new to AFL and trying to learn. Pl. any friend can help to correct this AFL.The mistake is starting from // EMA line.
Regards.
nms
_SECTION_BEGIN("EMA3 + EMA15 Cross");
EMA5_LineShow = ParamToggle("EMA3 Line", "Hide|Show",1);
EMA15_LineShow = ParamToggle("EMA15 Line", "Hide|Show",1);
CrossArrow_EMA3EMA15 = ParamToggle("CrossArrow-EMA3+EMA15", "Hide|Show",1);
EMA3LineColor = ParamColor("EMA3 Color", colorRose);
EMA15LineColor = ParamColor("EMA15 Color", colorTeal);
BuyTextColor = ParamColor("Buy Text", colorBrightGreen);
SellTextColor = ParamColor("Sell Text", colorRed);
SellTextBgr = ParamColor("Sell Text Bg", colorYellow);
BuyEMA3EMA15 = ParamColor("Buy Arrow", colorBrightGreen);
SellEMA3EMA15 = ParamColor("Sell Arrow", colorLightYellow);
//EMA Line
if(EMA3EMA15 == 0 || EMA3_LineShow == 0) {
Plot(EMA(Close,3),"EMA3 Line",EMA3LineColor, styleLine);
}
if(EMA3EMA15 == 0 || EMA30_LineShow == 0) {
Plot(EMA(Close,15),"EMA15 Line",EMA15LineColor, styleLine);
}
//CrossArrow_EMA3_EMA15
if(EMA3EMA15 == 0 || CrossArrow_EMA3EMA15 == 0) {
Buy=Cross(EMA(Close,3), EMA(Close,15));
Sell=Cross(EMA(Close,15), EMA(Close,3));
dist = 1.5*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist, BuyTextColor );
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist, SellTextColor, SellTextBgr );
}
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, BuyEMA3EMA15, SellEMA3EMA15 ), 0, IIf( Buy, Low, High ), -30 );
GraphXSpace = 10;
}
_SECTION_END();
This seems to be incomplete code, check the original source of code, EMA3EMA15 is not defined in your above code