You are on page 1of 7

_SECTION_BEGIN("talking system");

//------------------------------------------------------------------------------
//
// This indicator displays how far the closing price is above or below a 20
// period moving average in % terms. It is displayed as a histogram and the
// bars are green if the closing price is above the MA and red if the closing
// price is below the MA.
//
// T may be changed to alter the MA period. ie Change T=20 to T=200 for the
// 200 period MA.
//
// /*talking system*/
//
// T=20; /*Time Period for MA*/
//
// KMA=((C-MA(C,T))/MA(C,T))*100;
//
// GRAPH0=KMA;
//
// GRAPH0STYLE=2+4;
//
// GRAPH0BARCOLOR=iif(KMA>0,5,4);
//
// graphxspace=5;
//
//
// Mark Grid lines:
//
// Level 0
//
// Limits
//
// Show dates
//
// Percent
//
// Middle
//
//------------------------------------------------------------------------------
/*talking system*/
T=20; /*Time Period for MA*/
KMA=((C-MA(C,T))/MA(C,T))*100;
Graph0=KMA;
Graph0Style=2+4;
Graph0BarColor=IIf(KMA>0,5,4);
GraphXSpace=5;
_SECTION_END();
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Cl
ose %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlue ),styleNoTitle | ParamStyle("St
yle") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("HA");
//calculates floor pivots from previous days data & plots it on the present intr
aday chart.
//RED LINE = RESISTANCE
//RED DASHED LINE = MINI RESISTANCE
//BLUE LINE = SUPPORT
//BLUE DASHED LINE = MINI SUPPORT
//YELLOW DOTTED LINE = PIVOT
//RED DOTTED LINE = PREVIOUS Day High
//BLUE DOTTED LINE = PREVIOUS Day Low
//BLACK DOTTED LINE = PREVIOUS Day Close
//TIME FRAME CALCULATION
H1 = TimeFrameGetPrice("H", inDaily, -1); // yesterdays high
L1 = TimeFrameGetPrice("L", inDaily, -1); //
low
C1= TimeFrameGetPrice("C", inDaily, -1); //
close
DayO = TimeFrameGetPrice("O", inDaily); // current day open
// PIVOT Calculation
P = ( H1+ L1 + C1 )/3;
S1 = (2*P)-H1;
R1 = (2*P)-L1;
S2 = P -(H1 - L1);
S3 = S1 - (H1-L1);
S4 = S2 - (H1-L1);
S5 = S3 - (H1-L1);
R2 = P +(H1 - L1);
R3 = R1 +(H1-L1);
R4 = R2 +(H1-L1);
R5 = R3 +(H1-L1);
// PIVOT mid points
MIDR1 = (P+R1)/2;
MIDR2 = (R1+R2)/2;
MIDR3 = (R2+R3)/2;
MIDR4 = (R3+R4)/2;
MIDR5 = (R4+R5)/2;
MIDS1 = (P+S1)/2;
MIDS2 = (S1+S2)/2;
MIDS3 = (S2+S3)/2;
MIDS4 = (S3+S4)/2;
MIDS5 = (S4+S5)/2;
//PLOTS
Plot(C1, "",colorRed,styleDashed+styleNoRescale);
Plot(H1, "",colorDarkGrey,styleDashed+styleNoRescale);
Plot(L1, "",colorDarkGrey,styleDashed+styleNoRescale);
_SECTION_BEGIN("Draw Camarilla Levels");
SetChartOptions(0,chartShowArrows|chartShowDates);
showcamarella=ParamList("Show Camarella Lines","YES|NO");
showcandlechart=ParamList("Show Candle chart","YES|NO");
showwhat=IIf(ParamList("Todays or Tomorrows Levels","Today|Tomorrow")=="Tomorrow
",1,-1);
if (showcandlechart=="YES")
{
}
EMA10=EMA(C,10);
EMA3=EMA(C,3);
XH = TimeFrameGetPrice( "H", inDaily,showwhat);
XL = TimeFrameGetPrice( "L", inDaily,showwhat);
XC = TimeFrameGetPrice( "C", inDaily, showwhat );
r2=(((xh-xl)*1.1)/2)+xc;
r1=(((xh-xl)*1.1)/4)+xc;
s1=(xc-((xh-xl)*1.1)/4);
s2=(xc-((xh-xl)*1.1)/2);
n3=1;
tgt1=(1+.005*n3)*r2;
tgt2=(1+.01*n3)*r2;
tgt5=(1+.015*n3)*r2;
tgt3=s2/(1+.005*n3);
tgt4=s2/(1+.01*n3);
tgt6=s2/(1+.015*n3);
Plot(r1,"R1",colorDarkRed,styleNoLine+styleNoRescale);
Plot(s1,"S1",colorDarkGreen,styleNoLine+styleNoRescale);
Plot(r2,"R2",colorRed,styleLine+styleNoRescale);
Plot(s2,"S2",colorGreen,styleLine+styleNoRescale);
Plot(tgt1,"tgt1",colorBlue,styleDashed|styleNoRescale);
Plot(tgt3,"tgt3",colorBlue,styleDashed|styleNoRescale);
Plot(tgt2,"tgt2",colorDarkYellow,styleDots|styleNoLine|styleNoRescale);
Plot(tgt4,"tgt4",colorDarkYellow,styleDots|styleNoLine|styleNoRescale);
Plot(tgt5,"tgt5",colorDarkYellow,styleNoLine|styleNoRescale);
Plot(tgt6,"tgt6",colorDarkYellow,styleNoLine|styleNoRescale);
_SECTION_BEGIN("Magnified Price");
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorYellow) );
Hor=Param("Horizontal Position",550,1,1200,1);
Ver=Param("Vertical Position",1,1,830,1);
GfxTextOut(""+C, Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Times New Roman", 11, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorYellow) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor , Ver+45 );
_SECTION_END();
//Topping Bar
//Range = H - L ;
//TPB = Volume > MA(Volume,9) AND Close < Low + Range/2 AND Range <=Ref(Range,-1
);
//PlotShapes(shapeSmallCircle * TPB,colorYellow,0,H,20);
// Buy adjustments
bs=Param("BUY Sensitivity",7,2,20,1);
bf=Param("BUY Finetune",2,0.1,20,0.1);
///uncommentf for optimization
//bs=Optimize("BUY Sensitivity",7,2,20,1);
//bf=Optimize("BUY Finetune",2,0.1,20,0.1);
// Sell Adjustments
ss=Param("SELL Sensitivity",5,2,20,1);
sf=Param("SELL Finetune",1,0.1,20,0.1);
///uncommentf for optimization
ss=Optimize("SELL Sensitivity",5,2,20,1);
sf=Optimize("SELL Finetune",1,0.1,20,0.1);
//stock selection parameters
MyCL = Param( "CL", 10, 10, 100, 10 );
MyVK = Param( "VK", 30, 10, 100, 10 );
MyTL = Param( "TL", 300, 100, 1000, 100 );
//stock selection
//TLM = EMA(C*V/100000,100) ;
//include = C> MyCL AND V/1000> MyVK AND C*V/100000 > MyTL AND TLM > 0.333 * MyT
L ;
// common
fast = 2/(2+1);
slow = 2/(30+1);
//BUY part
dirb=abs(Close-Ref(Close,-bs));
volb=Sum(abs(Close-Ref(Close,-1)),bs);
ERb=dirb/volb;
scb =( ERb*(fast-slow)+slow)^2;
xb = AMA( C, scb );
flb=bf*StDev(xb-Ref(xb,-1),20);
j=xb-Ref(xb,-3);
//SELL part
dirs=abs(Close-Ref(Close,-ss));
vols=Sum(abs(Close-Ref(Close,-1)),ss);
ERs=dirs/vols;
scs =( ERs*(fast-slow)+slow)^2;
xs = AMA( C, scs );
fls=sf*StDev(xs-Ref(xs,-1),20);
k=Ref(Xs,-3)-Xs;
Buy=Cross(j,flb) ;
Sell=Cross(k,fls);
mycolor=IIf(C>xb,colorLime,colorRed);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
shape = Buy * shapeUpArrow +Sell * shapeDownArrow ;
AlertIf( Buy, "SOUND C:\\Windows\\Media\\Chord.wav", "Audio alert", 2 );
AlertIf( Sell, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 2 );

PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-30);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-20);

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-25);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);

PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);
_SECTION_END();

_SECTION_BEGIN("Title");
if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorWhite)+ Name() + " - " + EncodeColor(colorRed)+ Interva
l(2) + EncodeColor(colorWhite) +
" - " + Date() + " - "+"\n" + EncodeColor(colorYellow) + "Op-"+O+" "+"Hi-"+H+
" "+"Lo-"+L+" "+"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+"\n");
_SECTION_END();
// Paste the code below to your price chart somewhere and green ribbon means bot
h
// both MACD and ADX trending up so if the red ribbon shows up the MACD and the
ADX
// are both trending down.
_SECTION_BEGIN("trending ribbon");
uptrend=PDI()>MDI()AND Signal()<MACD();
downtrend=MDI()>PDI()AND Signal()>MACD();
Plot( 2, /* defines the height of the ribbon in percent of pane width*/"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */styl
eOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
_SECTION_BEGIN("Fibo Retrace and Extensions");
fibs = ParamToggle("Plot Fibs","Off|On",1);
pctH = Param ("Pivot Hi %", 0.325,0.001,2.0,0.002);
HiLB = Param ("Hi LookBack",1,1,BarCount-1,1);
pctL = Param ("Pivot Lo %", 0.325,0.001,2.0,0.002);
LoLB = Param ("Lo LookBack",1,1,BarCount-1,1);
Back = Param ("Extend Left = 2",1,1,500,1);
Fwd = Param("Plot Forward", 0, 0, 500, 1);
text = ParamToggle("Plot Text","Off|On",1);
hts = Param ("Text Shift", -33.5,-50,50,0.10);
style =ParamStyle("Line Style",styleLine,styleNoLabel);
x = BarIndex();
pRp = PeakBars( H, pctH, 1) == 0;
yRp0 = SelectedValue(ValueWhen( pRp, H, HiLB));
xRp0 = SelectedValue(ValueWhen( pRp, x, HiLB));
pSp = TroughBars( L, pctL, 1) == 0;
ySp0 = SelectedValue(ValueWhen( pSp, L, LoLB));
xSp0 = SelectedValue(ValueWhen( pSp, x, LoLB));
Delta = yRp0 - ySp0;
function fib(ret)
{
retval = (Delta * ret);
Fibval = IIf(ret < 1.0
AND xSp0 < xRp0, yRp0 - retval, IIf(ret < 1.0
AND xSp0 > xRp0, ySp0 + retval,IIf(ret > 1.0
AND xSp0 < xRp0, yRp0 - retval, IIf(ret > 1.0
AND xSp0 > xRp0, ySp0 + retval, Null))));
return FibVal;
}
x0 = Min(xSp0,xRp0)-Back;
x1 = (BarCount -1);
r236 = fib(0.236); r236I = LastValue (r236,1);
r382 = fib(0.382); r382I = LastValue (r382,1);
r050 = fib(0.50); r050I = LastValue (r050,1);
r618 = fib(0.618); r618I = LastValue (r618,1);
r786 = fib(0.786); r786I = LastValue (r786,1);
e127 = fib(1.27); e127I = LastValue (e127,1);
e162 = fib(1.62); e162I = LastValue (e162,1);
e200 = fib(2.00); e200I = LastValue (e200,1);
e262 = fib(2.62); e262I = LastValue (e262,1);
e424 = fib(4.24); e424I = LastValue (e424,1);
p00 = IIf(xSp0 > xRp0,ySp0,yRp0); p00I = LastValue (p00,1);
p100 = IIf(xSp0 < xRp0,ySp0,yRp0); p100I = LastValue (p100,1);
color00 =IIf(xSp0 > xRp0,colorLime,colorRed);
color100 =IIf(xSp0 < xRp0,colorLime,colorRed);
numbars = LastValue(Cum(Status("barvisible")));
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);
if(fibs==1)
{
}
if(text==1)
{
PlotText(" 0% = " + WriteVal(p00,fraction), LastValue(BarIndex())-(numbars/h
ts), p00I + 0.05, color00);
PlotText("100% = " + WriteVal(p100,fraction), LastValue(BarIndex())-(numbars/hts
),p100I + 0.05, color100);
PlotText("38% = " + WriteVal(r382,fraction), LastValue(BarIndex())-(numbars/hts)
, r382I + 0.05, 44);
PlotText("62% = " + WriteVal(r618,fraction), LastValue(BarIndex())-(numbars/hts)
, r618I + 0.05, 43);
PlotText("127% = " + WriteVal(e127,fraction), LastValue(BarIndex())-(numbars/hts
),e127I + 0.05, 47);
PlotText("162% = " + WriteVal(e162,fraction), LastValue(BarIndex())-(numbars/hts
),e162I + 0.05, 47);
PlotText("200% = " + WriteVal(e200,fraction), LastValue(BarIndex())-(numbars/hts
),e200I + 0.05, 47);
PlotText("262% = " + WriteVal(e262,fraction), LastValue(BarIndex())-(numbars/hts
),e262I + 0.05, 47);
PlotText("424% = " + WriteVal(e424,fraction), LastValue(BarIndex())-(numbars/hts
),e424I + 0.05, 25);
}
_SECTION_END();
risk = 2;
Plot(Op=TimeFrameGetPrice("O",inDaily,0), "Open", colorGreen,styleNoLine);
Plot(EMA(C,89),"89 EMA ",colorYellow,styleLine|styleThick);
Plot(EMA(C,25),"89 EMA ",colorGreen,styleDashed|styleThick);
Plot(EMA(C,50),"89 EMA ",colorTurquoise,styleDashed|styleThick);
// Background color
SetChartBkColor(ParamColor("Panel color ",colorBlack));

You might also like