/ _SECTION_BEGIN("ADX"); pl = MA((H+L+C)/3,3); Col_pl = IIf(pl > Ref(pl,-1),colorGreen,colorRed); Plot (PL,"",Col_pl,styleThick); range = Param("trend period", 14, 2, 200, 1 ); em = Param("EMA Of the trend",5,1,20,1); p = EMA(PDI(range),em); m = EMA(MDI(range),em); pe = p-m; bbtop = BBandTop(pe,5,0.5); bbbot = BBandBot(pe,5,0.5); Col_pm = IIf(p > m, colorGreen,colorRed); Buy = pe > bbtop AND Col_pl == colorGreen; Sell = pe < bbbot AND Col_pl == colorRed; Col_bar =IIf(Buy AND p > Ref(p,-1),colorAqua,IIf(Sell AND m > Ref(m,-1),colorRed,IIf(Buy,colorBlue, IIf(Sell,colorDarkRed,colorYellow)))); //Col_bar =IIf(Buy ,colorGreen,IIf(Sell ,colorRed,colorYellow)); Plot(Close,"",col_bar,styleCandle); Buy = ExRem(Buy,Sell); Sell = ExRem(Sell,Buy); PlotShapes(Buy*shapeHollowSmallUpTriangle,colorBlue); PlotShapes(Sell*shapeHollowSmallDownTriangle,colorBlue); TimeFrameSet(in1Minute*2); pl = MA((H+L+C)/3,3); Col_pl = IIf(pl > Ref(pl,-1),colorGreen,colorRed); //range = Param("ADX Periods", 7, 2, 200, 1 ); //em = Param("EMA Of ADX",3,1,20,1); p = EMA(PDI(range),em); m = EMA(MDI(range),em); pe = p-m; bbtop = BBandTop(pe,5,0.5); bbbot = BBandBot(pe,5,0.5); Buy5 = p > m; Sell5 = p < m; Col_bar5 =IIf(Buy5 AND p > Ref(p,-1),colorBrightGreen,IIf(Sell5 AND m > Ref(m,-1),colorRed,IIf(buy5,colorDarkGreen, IIf(sell5,colorDarkRed,colorYellow)))); TimeFrameRestore(); Plot(1, "", Col_pm, styleOwnScale| styleArea|styleNoLabel,-0.5,100); Plot(5, "", Col_bar, styleOwnScale| styleArea|styleNoLabel,-0.5,100); Plot(6, "", colorBlack, styleOwnScale| styleArea|styleNoLabel,-0.5,100); //Plot(8, "", Col_bar5, styleOwnScale| styleArea|styleNoLabel,-0.5,100); _SECTION_END(); _SECTION_BEGIN("Fibo for all bars"); TimeFrameSet( in15Minute*2 ); DH=Ref(H,-1); DL=Ref(L,-1); DC=Ref(C,-1); pd = ( DH+ DL + DC )/3; sd1 = (2*pd)-DH; sd2 = pd -(DH - DL); sd3 = Sd1 - (DH-DL); rd1 = (2*pd)-DL; rd2 = pd +(DH -DL); rd3 = rd1 +(DH-DL); //Plot (pd,"Pivot",colorBlue,styleDots); //Plot (rd1," R1 ",35,styleDots); //Plot (rd2," R2 ",35,styleDots); //Plot (rd3," R3 ",35,styleDots); //Plot (sd1," S1 ",4,styleDots); //Plot (Sd2," S2 ",4,styleDots); //Plot (Sd3," S3 ",4,8+16); /* style = IIf(ParamList("Chart style", "styleCandle|styleBar")=="styleCandle",64,128+4); Plot (C,Date ()+" close",1,style); //ENABLE THIS TO HAVE CANDLES AS WELL */ TimeFrameRestore(); Title = EncodeColor(colorWhite)+ "LINKON'S PIVOT TRADING SYSTEM" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) + " - " + Date() +" - "+"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+ "Cl-"+C+" " + WriteIf(C > pd, EncodeColor(colorGreen)+"stay long",EncodeColor(colorRed)+"stay SHORT") + "\n" + "Vol= "+ WriteVal(V) +WriteIf ( V > MA(V,26) ,EncodeColor(colorGreen)+" UP "+ (V/MA(V,26))*100 + " %", EncodeColor(colorRed)+" DOWN "+ (V/MA(V,26))*100 + " %") + EncodeColor(colorGreen)+ "\n R3 : "+ EncodeColor(colorWhite)+RD3 + EncodeColor(colorGreen)+ "\n R2 : "+ EncodeColor(colorWhite)+RD2 + EncodeColor(colorGreen)+ "\n R1 : "+ EncodeColor(colorWhite)+RD1 + EncodeColor(colorBlue)+ "\n Pivot : "+ EncodeColor(colorWhite)+pd + EncodeColor(colorRed)+ "\n S1 : "+ EncodeColor(colorWhite)+SD1 + EncodeColor(colorRed)+ "\n S2 : "+ EncodeColor(colorWhite)+SD2 + EncodeColor(colorRed)+ "\n S3 : "+ EncodeColor(colorWhite)+SD3 ; _SECTION_BEGIN("Bollinger Bands"); P = ParamField("Price field",-1); Periods = Param("Periods", 15, 2, 300, 1 ); Width = Param("Width", 2, 0, 10, 0.05 ); Color = ParamColor("Color", colorCycle ); Style = ParamStyle("Style"); Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style ); Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style ); _SECTION_END(); _SECTION_BEGIN("Bollinger Bands1"); P = ParamField("Price field",-1); Periods = Param("Periods", 15, 2, 300, 1 ); Width = Param("Width", 2, 0, 10, 0.05 ); Color = ParamColor("Color", colorCycle ); Style = ParamStyle("Style"); Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style ); Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style ); _SECTION_END();