Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _SECTION_BEGIN("Heiken Ashi Smoothed");
- SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack),ParamColor("Titleblock",colorBlack ));
- SetChartOptions(0,chartShowArrows|chartShowDates);
- GraphXSpace=5;
- p=Param("Period",6,2,30,1);
- Om=MA(O,p);
- hm=MA(H,p);
- lm=MA(L,p);
- Cm=MA(C,p);
- HACLOSE=(Om+Hm+Lm+Cm)/4;
- HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
- HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
- HaLow = Min( Lm, Min( HaClose, HaOpen ) );
- PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" + Name(), colorWhite, styleCandle | styleNoLabel );
- _SECTION_END();
- _SECTION_BEGIN("Background Color");
- BKswitch = ParamToggle("Background Color","On,Off");
- OUTcolor = ParamColor("Outer Panel Color",colorBlack);
- INUPcolor = ParamColor("Inner Panel Upper",colorPink);
- INDNcolor = ParamColor("Inner Panel Lower",colorBlack);
- TitleColor = ParamColor("Title Color ",colorBlack);
- if (NOT BKswitch)
- {
- SetChartBkColor(OUTcolor); // color of outer border
- SetChartBkGradientFill(INUPcolor,INDNcolor,TitleColor); // color of inner panel
- }
- _SECTION_END();
- _SECTION_BEGIN("ERO ATR BUY SELL");
- ero = Param("ATR multiple", 2.8, 0.5, 10, 0.1 )*Param("ATR period", 10, 3, 50 );
- ero_col=ParamColor( "Color", colorCycle );
- r=HHV(H,ero);
- s=LLV(L,ero);
- ab=IIf(H>Ref(r,-1),1,IIf(L<Ref(s,-1),-1,0));
- ac=ValueWhen(ab!=0,ab,1);
- sl=IIf(ac==1,s,r);
- Plot(sl, _DEFAULT_NAME(), ero_col, styleStaircase); // or styleaArea
- Buy=Cross(H,sl);
- Sell=Cross(sl,L);
- PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
- PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
- PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
- PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
- PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
- PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
- _SECTION_END();
- _SECTION_BEGIN("Moving Average");
- x=Param("EMA 1",20,1,200,1);
- y=Param("EMA 2", 50,1,200,1);
- z=Param("EMA 3",100,1,200,1);
- zz=Param("EMA 4",200,1,200,1);
- EMA20= EMA(C,x);
- EMA50=EMA(C,y);
- EMA100= EMA(C,z);
- EMA200=EMA(C,zz);
- SUT=EMA(C,5)>EMA20;
- SDT=EMA20>EMA(C,5);
- mut= EMA20>EMA50;
- mdt=EMA20<EMA50;
- _SECTION_END();
- _SECTION_BEGIN("LEVELS");
- PO=TimeFrameGetPrice( "O", inDaily, -1 );
- PL=TimeFrameGetPrice( "L", inDaily, -1 );
- PH=TimeFrameGetPrice( "H", inDaily, -1 );
- PC=TimeFrameGetPrice( "C", inDaily, -1 );
- TO= TimeFrameGetPrice( "O", inDaily, 0 );
- TH= TimeFrameGetPrice( "H", inDaily, 0 );
- TL= TimeFrameGetPrice( "L", inDaily, 0 );
- TC= TimeFrameGetPrice( "C", inDaily, 0 );
- PC1= TimeFrameGetPrice( "C", inDaily, -2 );
- P=((PH+PL+PC)/3);
- R1=((2*P)-PL);
- S1=((2*P)-PH);
- R2=((P-S1)+R1);
- S2=(P-(R1-S1));
- R3=PH+(2*(P-PL));
- S3=PL-(2*(PH-P));
- R=TH-TL;
- PP=(TH+TL+TO+TO)/4;
- RR1=PP+(R*0.38);
- RR2=PP+(R*0.62);
- SS1=PP-(R*0.38);
- SS2=PP-(R*0.62);
- PPP=(TH+TL+TO+TO)/4;
- RRR1=((2*PPP)-TL);
- SSS1=((2*PPP)-TH);
- RRR2=((PPP-SSS1)+RRR1);
- SSS2=(PPP-(RRR1-SSS1));
- Pchange=PC-PC1;
- PPerChange=(Pchange/PC1)*100;
- Tchange=TC-PC;
- TPerChange=(Tchange/TC)*100;
- Title=Name()+
- "\nPrevious - O :-"+PO+" H :-"+PH+" L :-"+PL+" C :-"+PC+" Change:- "+Pchange+" %ge:- "+WriteVal(PPerChange,1.2)+
- "\nTodays - O :-"+TO+" H :-"+TH+" L :-"+TL+" C :-"+TC+" Change:- "+Tchange+" %ge:- "+WriteVal(TPerChange,1.2)+
- "\n"+
- "\n"+
- "\nLevels"+
- "\nEOD Pivot :-"+WriteVal(P,1.2)+
- "\nS-1 :-"+WriteVal(S1,1.2)+" - R-1 :-"+WriteVal(R1,1.2)+
- "\nS-2 :-"+WriteVal(S2,1.2)+" - R-2 :-"+WriteVal(R2,1.2)+
- "\nS-3 :-"+WriteVal(S3,1.2)+" - R-3 :-"+WriteVal(R3,1.2)+
- "\n"+
- "\nIntraday Pivot :-"+WriteVal(PP,1.2)+
- "\nS-1 :-"+WriteVal(SSS1,1.2)+" - R-1 :-"+WriteVal(RRR1,1.2)+
- "\nS-2 :-"+WriteVal(SSS2,1.2)+" - R-2 :-"+WriteVal(RRR2,1.2)+
- "\n"+
- "\nIntraday Retracement Levels"+
- "\nS-1 :-"+WriteVal(SS1,1.2)+" - R-1:-"+WriteVal(RR1,1.2)+
- "\nS-2 :-"+WriteVal(SS2,1.2)+" - R-2:-"+WriteVal(RR2,1.2);
- _SECTION_END();
- //------------------------------------------------------------------------------
- _SECTION_BEGIN("traing sl");
- function vstop_func(trBull,trBear)
- {
- trailArray[ 0 ] = C[ 0 ]; // initialize
- for( i = 1; i < BarCount; i++ )
- {
- prev = trailArray[ i - 1 ];
- if (C[ i ] > prev AND C[ i - 1 ] > prev)
- {
- trailArray[ i ] = Max(prev,C[ i ] - trBull[ i ]);
- }
- else if (C[ i ] < prev AND C[ i - 1 ] < prev)
- {
- trailArray[ i ] = Min(prev,C[ i ] + trBear[ i ]);
- }
- else if (C[ i ] > prev)
- {
- trailArray[ i ] = C[ i ] - trBull[ i ];
- }
- else
- {
- trailArray[ i ] = C[ i ] + trBear[ i ];
- }
- }
- return trailArray;
- }
- per = Param("per",20, 1, 150, 1);
- multBull = Param("multBull",2, 1, 4, 0.05);
- multBear = Param("multBear",2, 1, 4, 0.05);
- trBull = multBull * ATR(per);
- trBear = multBear * ATR(per);
- trailArray = vstop_func(trBull,trBear);
- s0=trailArray;
- s1= s0 > C ;
- s2= s0 <C ;
- ccresult1 = WriteIf( s1,"cu", "");
- ccresult2 = WriteIf( s2,"cd", "");
- GfxSelectFont("arial", 13, 700 ); GfxSetBkMode( colorRed);
- GfxSetTextColor( ParamColor("Color",colorRed) );
- Hor=Param("Horizontal Position",677,10,1200,1);
- Ver=Param("Vertical Position",50,100,50,50);
- if ( ccresult1 =="cu")
- {
- GfxTextOut(""+s0,Hor , Ver );
- }
- else
- GfxSelectFont("arial", 13, 700 ); GfxSetBkMode( colorGreen );
- GfxSetTextColor( ParamColor("Color",colorGreen) );
- Hor=Param("Horizontal Position",75,10,1200,1);
- Ver=Param("Vertical Position",185,100,50,50);
- if ( ccresult2 =="")
- {
- GfxTextOut(""+s0,Hor , Ver );
- }
- _SECTION_END();
- _SECTION_BEGIN("traing s2");
- s0=trailArray;
- s1= s0 > C ;
- s2= s0 <C ;
- ccresult1 = WriteIf( s1,"cu", "");
- ccresult2 = WriteIf( s2,"cd", "");
- GfxSelectFont("arial", 13, 700 ); GfxSetBkMode( colorBrightGreen );
- GfxSetTextColor( ParamColor("Color",colorBrightGreen) );
- Hor=Param("Horizontal Position",677,10,1200,1);
- Ver=Param("Vertical Position",50,100,50,50);
- if ( ccresult2 =="cd")
- {
- GfxTextOut(""+s0,Hor , Ver );
- }
- else
- GfxSelectFont("arial", 13, 700 ); GfxSetBkMode( colorWhite );
- GfxSetTextColor( ParamColor("Color",colorWhite) );
- Hor=Param("Horizontal Position",75,10,1200,1);
- Ver=Param("Vertical Position",185,100,50,50);
- if ( ccresult1 =="")
- {
- GfxTextOut(""+s0,Hor , Ver );
- }
- _SECTION_END();
- _SECTION_BEGIN("CMP");
- GfxSelectFont("arial", 13, 700 ); GfxSetBkMode( colorWhite );
- GfxSetTextColor( ParamColor("Color",colorWhite) );
- Hor=Param("Horizontal Position",777,10,1200,1);
- Ver=Param("Vertical Position",50,100,50,50);
- GfxTextOut(""+C,Hor , Ver );
- _SECTION_END();
- _SECTION_BEGIN("buycircle");
- GfxSelectFont( "Arial", 1, 100 );
- GfxSetBkMode( 1 );
- GfxSetTextColor( colorBlue );
- GfxSelectPen( colorBlue, 1 );
- if ( ccresult2 =="cd")
- {
- GfxSelectSolidBrush( ColorRGB(0,255,0) );
- }
- else
- {
- GfxSelectSolidBrush( ColorRGB(0,0,94) );
- }
- GfxCircle( 700,10,10 );
- _SECTION_END();
- _SECTION_BEGIN("sellcircle");
- GfxSelectFont( "Arial", 10, 100 );
- GfxSetBkMode( 1 );
- GfxSetTextColor( colorBlue );
- GfxSelectPen( colorBlue, 1 );
- if ( ccresult1 =="cu")
- {
- GfxSelectSolidBrush( ColorRGB(255,0,0) );
- }
- else
- {
- GfxSelectSolidBrush( ColorRGB(0,0,94) );
- }
- GfxCircle( 800,10,10 );
- _SECTION_END();
- _SECTION_BEGIN("Ribbon");
- uptrend=PDI()>MDI()AND Signal()<MACD();
- downtrend=MDI()>PDI()AND Signal()>MACD();
- Plot( 1, /*efines the height of the ribbon in percent of pane width */"ribbon",
- IIf( uptrend, colorLime, IIf( downtrend, colorRed,IIf(Signal()<MACD(), colorWhite, colorWhite ))), /* choose color */
- styleOwnScale|styleArea|styleNoLabel, -0, 10 );
- _SECTION_END();
- _SECTION_BEGIN("system Ticker");
- function GetSecondNum()
- {
- Time = Now( 4 );
- Seconds = int( Time % 100 );
- Minutes = int( Time / 100 % 100 );
- Hours = int( Time / 10000 % 100 );
- SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
- return SecondNum;
- }
- RequestTimedRefresh( 1 );
- //----------------------------------------------------------------------------
- //----------------------------------------------------------------------------
- TimeFrame = Interval();
- SecNumber = GetSecondNum();
- Newperiod = SecNumber % TimeFrame == 0;
- SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
- SecsToGo = TimeFrame - SecsLeft;
- x=Param(" xposn",555,100,1000,1000);
- y=Param(" yposn",0,40,1000,1);
- GfxSelectSolidBrush( colorPink );
- GfxSelectPen( colorBlack, 2 );
- if ( NewPeriod )
- {
- GfxSelectSolidBrush( colorBlack );
- GfxSelectPen( colorBlack, 2 );
- Say( "New candle" );
- }
- GfxRoundRect( x+55, y+17, x-4, y-2, 0, 0 );
- GfxSetBkMode(1);
- GfxSelectFont( "Arial", 9, 700, False );
- GfxSetTextColor( colorBlack );
- GfxTextOut( "" +SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
- _SECTION_END();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement