/ _SECTION_BEGIN("MACD"); SetChartBkColor( colorBlack ) ; r1 = Param( "Fast avg", 11, 3, 20, 1 ); r2 = Param( "Slow avg", 35, 10, 35, 1 ); r3 = Param( "Signal avg", 6, 3, 20, 1 ); ml = MACD(r1, r2); sl = Signal(r1,r2,r3); Hst1 = ml-sl; q = Param("smooth hist",5,1,20,1); Hst = EMA(Hst1,q); A2=EMA(C,4)-EMA(C,34); r = Param("smooth macd",3,1,20,1); a1 = EMA(a2,r); BBtops=BBandTop(A1,10,1); BBbots=BBandBot(A1,10,1); //Color_bar=IIf(a1<0 AND a1>Ref(a1,-1), colorAqua,IIf(a1>0 AND a1>Ref(a1,-1),colorBlue,IIf(a1>0 AND a1BBtops, colorBlue,IIf(a1BBtop,colorBlue,IIf(hst < bbbot,colorRed, IIf (Hst > 0,colorBlue,colorRed))); //Plot( Hst, "secret", color , styleThick ); /* Buy = Cross (Hst,bbtop); Sell = Cross (bbtop,Hst); Short = Cross (bbbot,Hst); Cover = Cross (Hst,bbbot); */ band = Param("band",10,1,40,1); //Buy = Color == colorBlue AND Close > EMA(High,band); //Short = color== colorRed AND Close < EMA (Low,band); //Buy = Color == colorBlue AND Color_bar==colorBlue; //Short = color== colorRed AND Color_bar == colorRed; Buy = Color == colorBlue AND Color_bar==colorBlue AND Close > EMA(High,band); Short = color== colorRed AND Color_bar == colorRed AND Close < EMA (Low,band); Buy = ExRem(Buy, Short); Short = ExRem(Short, Buy); Sell = Short; Cover = Buy ; Hi = EMA(High,band); Lo = EMA(Low,band); //PlotShapes (Buy*shapeUpArrow,colorYellow); //PlotShapes (Short*shapeDownArrow,colorYellow); //PlotShapes (Sell*shapeHollowCircle,colorRed); //PlotShapes (Cover*shapeHollowCircle,colorGreen); Plot (Close,"close",Color_bar,styleCandle); Plot (Hi,"upper band",colorWhite,styleDashed); Plot (Lo,"lower band",colorWhite,styleDashed); Plot(5, "", Color, styleOwnScale| styleArea|styleNoLabel,-0.5,100); Plot(10, "", Color_bar, styleOwnScale| styleArea|styleNoLabel,-0.5,100); _SECTION_END(); _SECTION_BEGIN("magic"); EMA3 = EMA(RSI(14),3); ema27 = EMA(RSI(14),27); diff = ema3-EMA27; ema_short = EMA(diff,Param("short ema",1,1,20,1)); EMA_Long = EMA(diff,Param("long ema",5,1,20,1)); //Col_rsi = IIf (EMA_long > Ref(EMA_long,-1),colorBlue,colorRed); Col_rsi = IIf (EMA_short > 0,colorBlue,colorRed); Plot(15, "", Col_rsi, styleOwnScale| styleArea|styleNoLabel,-0.5,100); _SECTION_END(); _SECTION_BEGIN("Support & Resistance"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); //GraphXSpace=0.5; //Plot(C,"",colorWhite,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Res", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Sup", colorGreen, styleLine); } //Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; dist = 1.5*ATR(10); for( i = 0; i < BarCount; i++ ) { //if( Buy[i] ) PlotText( "Buy\n@" + C[ i ]+"\n sl :"+ValueWhen( supbase==Base, LLV(L,HHVperiod) ) , i, L[ i ]-dist[i], colorBlack,colorGreen ); //if( Short[i] ) PlotText( "Sell\n@" + C[ i ]+"\n sl :"+ ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), i, H[ i ]+dist[i], colorBlack, colorRed ); if( Buy[i] ) PlotText( "Buy\n@" + C[ i ] , i, L[ i ]-dist[i], colorBlack,colorGreen ); if( Short[i] ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist[i], colorBlack, colorRed ); } PlotShapes( Buy * shapeUpTriangle + Sell * shapeDownTriangle, IIf( Buy, colorYellow, colorYellow ) ); _SECTION_END();