// Downloaded From https://www.WiseStockTrader.com (Title = StrFormat( EncodeColor( colorRed ) + " {{DATE}} Open - %g, High - %g, Low - %g, Close - %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) + EncodeColor( colorRed ) + "\n www.Easylivetrade.com +ALERT"); _SECTION_BEGIN("Sound-script"); Length=Param("Length",25, 2); Deviation=Param("Deviation",2); MoneyRisk=Param("Money Risk", 1); LineStyle=ParamToggle("Display line mode", "No|Yes", 0); cUpTrendLine = ParamColor("UpTrendLine", colorGold); cDnTrendLine = ParamColor("DownTrendLine", colorGold); TurnedUp=Nz(StaticVarGet("TurnedUp")); TurnedDown=Nz(StaticVarGet("TurnedDown")); SoundON = ParamToggle("Sound","Off|On",1); procedure CalcTrend_proc(bbtop,bbbot,Length,MoneyRisk,SoundON,TurnedUp,TurnedDown) { global UpTrendLine; global DownTrendLine; global smax; global smin; UpTrendLine=Null; DownTrendLine=Null; smax=Null; smin=Null; trend=0; for (i=Length+1; ismax[i-1]) trend=1; if (C[i]0 && smin[i]smax[i-1]) smax[i]=smax[i-1]; bsmax[i]=smax[i]+0.5*(MoneyRisk-1)*(smax[i]-smin[i]); bsmin[i]=smin[i]-0.5*(MoneyRisk-1)*(smax[i]-smin[i]); if(trend>0 && bsmin[i]bsmax[i-1]) bsmax[i]=bsmax[i-1]; if (trend>0) { UpTrendLine[i]=bsmin[i]; if (SoundON==True && !TurnedUp && i==BarCount-1 && IsEmpty(UpTrendLine[i-1])) { Say("Attention please, Market Going, UP"); PopupWindow(Date()+ "\n > " + Name() + "\n > Buy : " + L[ i ] + "\n > Target : " +(L[i]*1.005) +"\n > Stop Loss : " + (L[i]*0.9975),"Alert", 100, 640*mtRandom(), 480*mtRandom()); TurnedUp=StaticVarSet("TurnedUp",1); TurnedDown=StaticVarSet("TurnedDown",0); } } if (trend<0) { DownTrendLine[i]=bsmax[i]; if (SoundON==True && !TurnedDown && i==BarCount-1 && IsEmpty(DownTrendLine[i-1])) { Say("Attention please, Market Going, DOWN"); PopupWindow( Date()+ "\n > " + Name() + "\n > Sell : " + H[i] + "\n > Target : " + (H[i]*0.995)+"\n > Stop Loss : " +(H[i]*1.0025),"Alert", 100, 640*mtRandom(), 480*mtRandom()); TurnedUp=StaticVarSet("TurnedUp",0); TurnedDown=StaticVarSet("TurnedDown",1); } } } } bbtop=BBandTop(C,Length,Deviation); bbbot=BBandBot(C,Length,Deviation); CalcTrend_proc(bbtop,bbbot,Length,MoneyRisk,SoundON,TurnedUp,TurnedDown); UpTrendSigNal=UpTrendLine AND IsEmpty(Ref(UpTrendLine,-1)); DownTrendSigNal=DownTrendLine AND IsEmpty(Ref(DownTrendLine,-1)); dist = 0.8*ATR(10); dist1 = 2*ATR(10); for( i = 0; i < BarCount; i++ ) { if( UpTrendSignal[i] ) { PlotText( "\nBuy:" + L[ i ] + "\nT= " + (L[i]*1.005) + "\nSL= " + (L[i]*0.9975), i, L[ i ]-dist[i], colorGreen, colorWhite ); } if( DownTrendSignal[i] ) { PlotText( "Sell:" + H[ i ] + "\nT= " + (H[i]*0.995) + "\nSL= " + (H[i]*1.0025), i, H[ i ]+dist1[i], colorRed, colorWhite ); } } DisplayStyle = styleNoLabel|styleLine|styleNoTitle; if(LineStyle == 0) DisplayStyle |= styleLine; Plot(UpTrendLine,"Buy Stop Loss",cUpTrendLine,DisplayStyle); Plot(DownTrendLine,"Sell Stop Loss",cDnTrendLine,DisplayStyle) ; PlotShapes(IIf(UpTrendSignal,shapeSquare,shapeNone),colorLime,0,bbbot,Offset=-1); PlotShapes(IIf(UpTrendSignal,shapeUpArrow,shapeNone),colorWhite,0,bbbot,Offset=-1); PlotShapes(IIf(DownTrendSignal,shapeSquare,shapeNone),colorOrange,0,bbtop,Offset=-1); PlotShapes(IIf(DownTrendSignal,shapeDownArrow,shapeNone),colorWhite,0,bbtop,Offset=-1); _SECTION_END(); prev=AMA2(C,1,0); d=IIf(C>Ref(Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),-1),Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))), IIf(CRef(state,-1); ss=stateMDI(10)AND Signal(29)PDI(20)AND Signal(29)>MACD(13); Plot( 2, /* defines the height of the ribbon in percent of pane width */"ribbon", IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */ styleOwnScale|styleArea|styleNoLabel, -0.5, 100 ); _SECTION_END(); // set background gradient colours SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 0,0,0 )),ParamColor("BgBottom", ColorRGB( 0,0,0 )),ParamColor("titleblock",ColorRGB( 255,255,255 ))); GraphXSpace = 5;