amibroker afl help!! (ichimoku)

#1
hi all members and moderators,
i have come through this ichimoku afl in this forum but need to change the alert parameters in this afl. currently i am getting alert when tenkensen crosses from above/below to kijun sen.
i need alert when chikau span crosses cloud (spanA and spanB) from below or above. i am planning to use it on 1hr timeframe so sound alert will be added advantage..
pls help me i will be very much thankful..

thanks in advance..

the afl is

_SECTION_BEGIN("LETSGROW");
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, "Close", ParamColor("Color", colorWhite ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Plot(C,"",colorRose, styleCandle );
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}


SL = ( HHV( H, 26 ) + LLV( L, 26) )/2; // standard, base, or kijun-sen line
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2; // turning, conversion, or tenkan-sen line
DL = Ref( C, 26 ); // delayed close price, or chikou span
Span1 = Ref( ( SL + TL )/2, -25 ); //Span1 and Span2 define the clouds
Span2 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);
/*
SL = ( HHV( H, 26 ) + LLV( L, 26) )/2;
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2;
DL = Ref( C, 26 );
Span1 = (( SL + TL )/2);
Span2 = (HHV( H, 52) + LLV(L, 52))/2;
*/
hue = Param("Hue",140,0,255,1);
sat = Param("Sat",100,0,255,1);
bri = Param("bri",220,0,255,1);

Plot(SL,"SL",colorBlue,styleThick); // standard, base, or kijun-sen line
Plot(TL,"TL",colorRed,styleThick); // turning, conversion, or tenkan-sen line
Plot(DL,"DL",colorLime ,styleThick); // delayed, lagging, or chikou span
//Plot(Span1,"",colorGreen,1,0,0,26); // senkou span A, kumo, or white clouds
//Plot(Span2,"",colorSeaGreen,1,0,0,26); // senkou span B, kumo, or white clouds
//PlotOHLC(Span1,Span1,Span2,Span2,"Cloud",ColorHSB( Hue,sat,bri),styleCloud);
//PlotOHLC(Span1,Span2,Span1,Span2,"",IIf(Span1>Span 2,8,9),styleCloud|4096,0,0,26);

Span1 = Ref( ( SL + TL )/2, -25 ); //Span1 and Span2 define the clouds
Span21 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);

SR=Span1-Span21;
Span2=Span1-0.05*SR;
Span3=Span1-0.1*SR;
Span4=Span1-0.15*SR;
Span5=Span1-0.2*SR;
Span6=Span1-0.25*SR;
Span7=Span1-0.3*SR;
Span8=Span1-0.35*SR;
Span9=Span1-0.4*SR;
Span10=Span1-0.45*SR;
Span11=Span1-0.5*SR;
Span12=Span1-0.55*SR;
Span13=Span1-0.6*SR;
Span14=Span1-0.65*SR;
Span15=Span1-0.7*SR;
Span16=Span1-0.75*SR;
Span17=Span1-0.8*SR;
Span18=Span1-0.85*SR;
Span19=Span1-0.9*SR;
Span20=Span1-0.95*SR;

ColorKumo=IIf(C>Span1,ColorRGB(10,100,40),IIf(C<Span2,ColorRGB(100,10,40),colorGrey40));



Plot(Span1,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span2,"",ColorKumo,styleDashed |styleNoLabel);
Plot(Span3,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span4,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span5,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span6,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span7,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span8,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span9,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span10,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span11,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span12,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span13,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span14,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span15,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span16,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span17,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span18,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span19,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span20,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span21,"",ColorKumo,styleDashed|styleNoLabel);



































Buy = Cross(TL,SL);
Sell = Cross(SL,TL);
shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
PlotShapes(shape,IIf(Buy,colorDarkGreen,colorRed), 0,IIf(Buy,Low,High));

above = IIf(TL>Span1 AND TL>Span2,1,0);
within = IIf(TL>Span1 AND TL<Span2,1,0);
below = IIf(TL<Span1 AND TL<Span2,1,0);
Buy = Cross(TL,SL) AND (DL>Close);
Sell = Cross(SL,TL) AND (DL<SL);
StrongBuy = Buy AND above;
MediumBuy = Buy AND within;
WeakBuy = Buy AND below;
StrongSell = Sell AND below;
MediumSell = Sell AND within;
WeakSell = Sell AND above;
//////////////////////////////////////////////////code addition //////////////////////////////////////////////////////////////

GraphXSpace = 5;
dist = 4.5*ATR(10);

//for( i = 0; i < BarCount; i++ )
//{if( Buy ) PlotText( "Buy\[email protected]" + C[ i ], i, L[ i ]-dist, colorGreen );
//if( Sell ) PlotText( "sell\[email protected]" + C[ i ], i, H[ i ]+dist, colorRed); }



for( i = 0; i < BarCount; i++)
{
if( StrongBuy )
PlotText( "StrongBuy\[email protected]" +C[ i ], i, L[ i ]-dist, colorBrightGreen );
if( MediumBuy )
PlotText( "MediumBuy" + C[ i ], i, L[ i ]-dist, ColorRGB(0,100,0) );
if( WeakBuy )
PlotText( "WeakBuy" + C[ i ], i, L[ i ]-dist, ColorRGB(0,50,0) );




if( StrongSell ) PlotText( "Strongsell\[email protected]" + C[ i ], i, H[ i ]+dist, ColorRGB(300,0,0));
if( MediumSell ) PlotText( "Mediumsell\[email protected]" + C[ i ], i, H[ i ]+dist, ColorRGB(150,0,0));
if( WeakSell ) PlotText( "Weaksell\[email protected]" + C[ i ], i, H[ i ]+dist, ColorRGB(50,0,0));
}






PlotShapes(StrongBuy*shapeUpTriangle,colorBrightGreen, 0, Low, Offset =-10);
//PlotShapes(StrongBuy*shapeDigit1,colorBrightGreen, 0, Low, Offset =-25);
PlotShapes(MediumBuy*shapeHollowUpTriangle,colorBrightGreen, 0, Low, Offset =0);
//PlotShapes(MediumBuy*shapeDigit2,colorBrightGreen, 0, Low, Offset =-15);
PlotShapes(WeakBuy*shapeHollowUpTriangle,colorGreen, 0, Low, Offset =-15);
//PlotShapes(WeakBuy*shapeDigit3,colorGreen, 0, Low, Offset =-30);


PlotShapes(StrongSell*shapeDownTriangle,colorRed, 0, High, Offset =-40);
//PlotShapes(StrongSell*shapeDigit1,colorRed, 0, High, Offset =55);
PlotShapes(MediumSell*shapeHollowDownTriangle,colorRed, 0, High, Offset =-40);
//PlotShapes(MediumSell*shapeDigit2,colorRed, 0, High, Offset =55);
PlotShapes(WeakSell*shapeHollowDownTriangle,colorRed, 0, High, Offset =-40);
//PlotShapes(WeakSell*shapeDigit3,colorRed, 0, High, Offset =55);


/////////////////////////////////////////////////////////exploration ////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
Filter=Buy OR Sell OR StrongBuy OR MediumBuy OR WeakBuy OR StrongSell OR MediumSell OR WeakSell;
AddColumn( IIf(Buy,C,IIf(Sell,-C,Null)) ,"bs",1.0,colorWhite,IIf(Buy,colorBrightGreen,IIf(Sell,colorRed,colorBlack)));
AddColumn( IIf(StrongBuy,C,IIf(StrongSell,-C,Null)) ,"STRONG",1.0,colorWhite,IIf(StrongBuy,colorBrightGreen,IIf(StrongSell,colorRed,colorBlack)));
AddColumn( IIf(MediumBuy,C,IIf(MediumSell,-C,Null)) ,"MEDIUM",1.0,colorWhite,IIf(MediumBuy,colorGreen,IIf(MediumSell,colorDarkRed,colorBlack)));
AddColumn( IIf(WeakBuy,C,IIf(WeakSell,-C,Null)) ,"WEAK",1.0,colorWhite,IIf(WeakBuy,colorGreen,IIf(WeakSell,colorDarkRed,colorBlack)));

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

IIf( (StrongBuy),PlotShapes(shapeUpTriangle*StrongBuy,colorGreen),0); // I want to show msg Strong Buy @ (price) Here wit Arrow
IIf( (MediumBuy),PlotShapes(shapeUpArrow*MediumBuy,colorGreen),0); // I want to show msg Medium Buy @ (price) Here wit Arrow
IIf( (WeakBuy),PlotShapes(shapeHollowUpArrow*WeakBuy,colorIndigo),0); // I want to show msg Weak Buy @ (price) Here wit Arrow
IIf( (StrongSell),PlotShapes(shapeDownTriangle*StrongSell,colorRed),0);// I want to show msg Strong Sell @ (price) Here wit Arrow
IIf( (MediumSell),PlotShapes(shapeDownArrow*MediumSell,colorRed),0); // I want to show msg Medium Sell @ (price)Here wit Arrow
_SECTION_END();
 

nms

Active Member
#3
hi all members and moderators,
i have come through this ichimoku afl in this forum but need to change the alert parameters in this afl. currently i am getting alert when tenkensen crosses from above/below to kijun sen.
i need alert when chikau span crosses cloud (spanA and spanB) from below or above. i am planning to use it on 1hr timeframe so sound alert will be added advantage..
pls help me i will be very much thankful..

thanks in advance..

the afl is

_SECTION_BEGIN("LETSGROW");
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, "Close", ParamColor("Color", colorWhite ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Plot(C,"",colorRose, styleCandle );
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}


SL = ( HHV( H, 26 ) + LLV( L, 26) )/2; // standard, base, or kijun-sen line
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2; // turning, conversion, or tenkan-sen line
DL = Ref( C, 26 ); // delayed close price, or chikou span
Span1 = Ref( ( SL + TL )/2, -25 ); //Span1 and Span2 define the clouds
Span2 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);
/*
SL = ( HHV( H, 26 ) + LLV( L, 26) )/2;
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2;
DL = Ref( C, 26 );
Span1 = (( SL + TL )/2);
Span2 = (HHV( H, 52) + LLV(L, 52))/2;
*/
hue = Param("Hue",140,0,255,1);
sat = Param("Sat",100,0,255,1);
bri = Param("bri",220,0,255,1);

Plot(SL,"SL",colorBlue,styleThick); // standard, base, or kijun-sen line
Plot(TL,"TL",colorRed,styleThick); // turning, conversion, or tenkan-sen line
Plot(DL,"DL",colorLime ,styleThick); // delayed, lagging, or chikou span
//Plot(Span1,"",colorGreen,1,0,0,26); // senkou span A, kumo, or white clouds
//Plot(Span2,"",colorSeaGreen,1,0,0,26); // senkou span B, kumo, or white clouds
//PlotOHLC(Span1,Span1,Span2,Span2,"Cloud",ColorHSB( Hue,sat,bri),styleCloud);
//PlotOHLC(Span1,Span2,Span1,Span2,"",IIf(Span1>Span 2,8,9),styleCloud|4096,0,0,26);

Span1 = Ref( ( SL + TL )/2, -25 ); //Span1 and Span2 define the clouds
Span21 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);

SR=Span1-Span21;
Span2=Span1-0.05*SR;
Span3=Span1-0.1*SR;
Span4=Span1-0.15*SR;
Span5=Span1-0.2*SR;
Span6=Span1-0.25*SR;
Span7=Span1-0.3*SR;
Span8=Span1-0.35*SR;
Span9=Span1-0.4*SR;
Span10=Span1-0.45*SR;
Span11=Span1-0.5*SR;
Span12=Span1-0.55*SR;
Span13=Span1-0.6*SR;
Span14=Span1-0.65*SR;
Span15=Span1-0.7*SR;
Span16=Span1-0.75*SR;
Span17=Span1-0.8*SR;
Span18=Span1-0.85*SR;
Span19=Span1-0.9*SR;
Span20=Span1-0.95*SR;

ColorKumo=IIf(C>Span1,ColorRGB(10,100,40),IIf(C<Span2,ColorRGB(100,10,40),colorGrey40));



Plot(Span1,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span2,"",ColorKumo,styleDashed |styleNoLabel);
Plot(Span3,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span4,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span5,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span6,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span7,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span8,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span9,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span10,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span11,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span12,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span13,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span14,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span15,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span16,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span17,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span18,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span19,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span20,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span21,"",ColorKumo,styleDashed|styleNoLabel);



































Buy = Cross(TL,SL);
Sell = Cross(SL,TL);
shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
PlotShapes(shape,IIf(Buy,colorDarkGreen,colorRed), 0,IIf(Buy,Low,High));

above = IIf(TL>Span1 AND TL>Span2,1,0);
within = IIf(TL>Span1 AND TL<Span2,1,0);
below = IIf(TL<Span1 AND TL<Span2,1,0);
Buy = Cross(TL,SL) AND (DL>Close);
Sell = Cross(SL,TL) AND (DL<SL);
StrongBuy = Buy AND above;
MediumBuy = Buy AND within;
WeakBuy = Buy AND below;
StrongSell = Sell AND below;
MediumSell = Sell AND within;
WeakSell = Sell AND above;
//////////////////////////////////////////////////code addition //////////////////////////////////////////////////////////////

GraphXSpace = 5;
dist = 4.5*ATR(10);

//for( i = 0; i < BarCount; i++ )
//{if( Buy ) PlotText( "Buy\[email protected]" + C[ i ], i, L[ i ]-dist, colorGreen );
//if( Sell ) PlotText( "sell\[email protected]" + C[ i ], i, H[ i ]+dist, colorRed); }




for( i = 0; i < BarCount; i++)
{
if( StrongBuy )
PlotText( "StrongBuy\[email protected]" +C[ i ], i, L[ i ]-dist, colorBrightGreen );
if( MediumBuy )
PlotText( "MediumBuy" + C[ i ], i, L[ i ]-dist, ColorRGB(0,100,0) );
if( WeakBuy )
PlotText( "WeakBuy" + C[ i ], i, L[ i ]-dist, ColorRGB(0,50,0) );





if( StrongSell ) PlotText( "Strongsell\[email protected]" + C[ i ], i, H[ i ]+dist, ColorRGB(300,0,0));
if( MediumSell ) PlotText( "Mediumsell\[email protected]" + C[ i ], i, H[ i ]+dist, ColorRGB(150,0,0));
if( WeakSell ) PlotText( "Weaksell\[email protected]" + C[ i ], i, H[ i ]+dist, ColorRGB(50,0,0));
}







PlotShapes(StrongBuy*shapeUpTriangle,colorBrightGreen, 0, Low, Offset =-10);
//PlotShapes(StrongBuy*shapeDigit1,colorBrightGreen, 0, Low, Offset =-25);
PlotShapes(MediumBuy*shapeHollowUpTriangle,colorBrightGreen, 0, Low, Offset =0);
//PlotShapes(MediumBuy*shapeDigit2,colorBrightGreen, 0, Low, Offset =-15);
PlotShapes(WeakBuy*shapeHollowUpTriangle,colorGreen, 0, Low, Offset =-15);
//PlotShapes(WeakBuy*shapeDigit3,colorGreen, 0, Low, Offset =-30);



PlotShapes(StrongSell*shapeDownTriangle,colorRed, 0, High, Offset =-40);
//PlotShapes(StrongSell*shapeDigit1,colorRed, 0, High, Offset =55);
PlotShapes(MediumSell*shapeHollowDownTriangle,colorRed, 0, High, Offset =-40);
//PlotShapes(MediumSell*shapeDigit2,colorRed, 0, High, Offset =55);
PlotShapes(WeakSell*shapeHollowDownTriangle,colorRed, 0, High, Offset =-40);
//PlotShapes(WeakSell*shapeDigit3,colorRed, 0, High, Offset =55);



/////////////////////////////////////////////////////////exploration ////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
Filter=Buy OR Sell OR StrongBuy OR MediumBuy OR WeakBuy OR StrongSell OR MediumSell OR WeakSell;
AddColumn( IIf(Buy,C,IIf(Sell,-C,Null)) ,"bs",1.0,colorWhite,IIf(Buy,colorBrightGreen,IIf(Sell,colorRed,colorBlack)));
AddColumn( IIf(StrongBuy,C,IIf(StrongSell,-C,Null)) ,"STRONG",1.0,colorWhite,IIf(StrongBuy,colorBrightGreen,IIf(StrongSell,colorRed,colorBlack)));
AddColumn( IIf(MediumBuy,C,IIf(MediumSell,-C,Null)) ,"MEDIUM",1.0,colorWhite,IIf(MediumBuy,colorGreen,IIf(MediumSell,colorDarkRed,colorBlack)));
AddColumn( IIf(WeakBuy,C,IIf(WeakSell,-C,Null)) ,"WEAK",1.0,colorWhite,IIf(WeakBuy,colorGreen,IIf(WeakSell,colorDarkRed,colorBlack)));


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

IIf( (StrongBuy),PlotShapes(shapeUpTriangle*StrongBuy,colorGreen),0); // I want to show msg Strong Buy @ (price) Here wit Arrow
IIf( (MediumBuy),PlotShapes(shapeUpArrow*MediumBuy,colorGreen),0); // I want to show msg Medium Buy @ (price) Here wit Arrow
IIf( (WeakBuy),PlotShapes(shapeHollowUpArrow*WeakBuy,colorIndigo),0); // I want to show msg Weak Buy @ (price) Here wit Arrow
IIf( (StrongSell),PlotShapes(shapeDownTriangle*StrongSell,colorRed),0);// I want to show msg Strong Sell @ (price) Here wit Arrow
IIf( (MediumSell),PlotShapes(shapeDownArrow*MediumSell,colorRed),0); // I want to show msg Medium Sell @ (price)Here wit Arrow
_SECTION_END();
Syntax error. Pl. rectify
 

Similar threads

Zerodha – Open Paperless Account

Open online account with Zerodha. Free delivery trading and Max Rs 20 for Intraday, F&O, Currency and Commodity Trading. Intraday High leverage with MIS, CO and BO.

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