Sie sind auf Seite 1von 10

_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;a
//
// 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, Close
%g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlue ),styleNoTitle |
ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_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();

_SECTION_BEGIN("Time Left");
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",300,0,1000,1);
y=Param("yposn",50,0,1000,1);

if ( NewPeriod )
{
GfxSelectSolidBrush( colorYellow );
GfxSelectPen( colorYellow, 2 );
Say( "New period" );
}
GfxRoundRect( x+45, y+17, x-3, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 12, 700, False );
GfxSetTextColor( colorYellow );
GfxTextOut( ""+SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
_SECTION_END();
// Paste the code below to your price chart somewhere and green ribbon means both
// both MACD and ADX trending up so if the red ribbon shows up the MACD and the ADX

// are both trending down.

// Background color

SetChartBkColor(ParamColor("Panel color ",colorBlack));

_SECTION_END();

//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

// Background color

SetChartBkColor(ParamColor("Panel color ",colorBlack));

_SECTION_END();

_SECTION_BEGIN("TREND");

SetBarsRequired(100000,0);
GraphXSpace = 15;

ea = EMA (C,10);
eb = EMA (C,20);
SetBarFillColor( IIf( ea > eb, colorGreen, colorRed ) );
Buy = ea > eb AND TimeNum() > 092000 AND TimeNum() < 150000;
Sell = eb > ea OR TimeNum() > 150000;
Short = 0;
Cover = 0;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = ExRem(Short,Cover);
Cover = ExRem(Cover,Short);
SetTradeDelays(1,1,1,1);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close


%g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

Factor=Param("Factor",4,1,10,1);
Pd=Param("ATR Periods",10,1,100,1);
Up=(H+L)/2+(Factor*ATR(Pd));
Dn=(H+L)/2-(Factor*ATR(Pd));
iATR=ATR(Pd);
TrendUp=TrendDown=Null;
trend[0]=1;
changeOfTrend=0;
flag=flagh=0;

for (i = 1; i <BarCount; i++) {


TrendUp[i] = Null;
TrendDown[i] = Null;

trend[i]=1;

if (Close[i]>Up[i-1]) {
trend[i]=1;
if (trend[i-1] == -1) changeOfTrend = 1;

}
else if (Close[i]<Dn[i-1]) {
trend[i]=-1;
if (trend[i-1] == 1) changeOfTrend = 1;
}
else if (trend[i-1]==1) {
trend[i]=1;
changeOfTrend = 0;
}
else if (trend[i-1]==-1) {
trend[i]=-1;
changeOfTrend = 0;
}

if (trend[i]<0 && trend[i-1]>0) {


flag=1;
}
else {
flag=0;
}

if (trend[i]>0 && trend[i-1]<0) {


flagh=1;
}
else {
flagh=0;
}

if (trend[i]>0 && Dn[i]<Dn[i-1]){


Dn[i]=Dn[i-1];
}

if (trend[i]<0 && Up[i]>Up[i-1])


{ Up[i]=Up[i-1];
}

if (flag==1)
{ Up[i]=(H[i]+L[i])/2+(Factor*iATR[i]);;
}
if (flagh==1)
{ Dn[i]=(H[i]+L[i])/2-(Factor*iATR[i]);;
}
if (trend[i]==1) {
TrendUp[i]=Dn[i];
if (changeOfTrend == 1) {
TrendUp[i-1] = TrendDown[i-1];
changeOfTrend = 0;
}
}
else if (trend[i]==-1) {
TrendDown[i]=Up[i];
if (changeOfTrend == 1) {
TrendDown[i-1] = TrendUp[i-1];
changeOfTrend = 0;
}
}
}

Buy = trend==1;
Sell=trend==-1;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=Sell;
Cover=Buy;

BuyPrice=ValueWhen(Buy,C);
SellPrice=ValueWhen(Sell,C);
ShortPrice=ValueWhen(Short,C);
CoverPrice=ValueWhen(Cover,C);

Title = EncodeColor(colorWhite)+ "win" + " - " + Name() + " - " +


EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorRed) +"Op-"+O+" "+"Hi-"+H+"
"+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+"\n"+
EncodeColor(colorLime)+
WriteIf (Buy , " GO LONG / Reverse Signal at "+C+" ","")+
WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")
+"\n"+EncodeColor(colorYellow)+
WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
WriteIf(Buy , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","");

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(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

TrendSL=IIf(trend==1,TrendUp,TrendDown);

for(i=BarCount-1;i>1;i--)
{
if(Buy[i] == 1)
{
entry = C[i];
sig = "BUY";
sl = TrendSL[i];
tar1 = entry + (entry * .0050);
tar2 = entry + (entry * .0092);
tar3 = entry + (entry * .0179);
tar4 = entry + (entry * .0300);

bars = i;
i = 0;
}
if(Sell[i] == 1)
{
sig = "SELL";
entry = C[i];
sl = TrendSL[i];
tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);
tar4 = entry - (entry * .0360);

bars = i;
i = 0;
}
}
Offset = 20;
Clr = IIf(sig == "BUY", colorLime, colorRed);
ssl = IIf(bars == BarCount-1, TrendSL[BarCount-1], Ref(TrendSL, -1));
sl = ssl[BarCount-1];

for (i=bars; i <BarCount;i++)


{

risk = 2;
Plot(Op=TimeFrameGetPrice("O",inDaily,0), "Open", colorDarkYellow,
styleStaircase+styleNoRescale);
DayH = TimeFrameGetPrice("H", inDaily, -1); DayHI = LastValue (DayH,1);//
yesterdays high
DayL = TimeFrameGetPrice("L", inDaily, -1); DayLI = LastValue (DayL,1); //
yesterdays low
DayC = TimeFrameGetPrice("C", inDaily, -1); // yesterdays close
DayO = TimeFrameGetPrice("O", inDaily); // current day open
DayH2= TimeFrameGetPrice("H", inDaily, -2); DayH2I = LastValue (DayH2,1); // Two
days before high
DayL2= TimeFrameGetPrice("L", inDaily, -2); DayL2I = LastValue (DayL2,1); // Two
days before low
DayH3= TimeFrameGetPrice("H", inDaily, -3); DayH3I = LastValue (DayH3,1); //
Three days before high
DayL3= TimeFrameGetPrice("L", inDaily, -3); DayL3I = LastValue (DayL3,1); //
Three days before low
DayH4= TimeFrameGetPrice("H", inDaily, -4); DayH4I = LastValue (DayH4,1); // Four
days before high
DayL4= TimeFrameGetPrice("L", inDaily, -4); DayL4I = LastValue (DayL4,1); // Four
days before low
DayH5= TimeFrameGetPrice("H", inDaily, -5); DayH5I = LastValue (DayH5,1); // Five
days before high
DayL5= TimeFrameGetPrice("L", inDaily, -5); DayL5I = LastValue (DayL5,1); // Five
days before low
DayH6= TimeFrameGetPrice("H", inDaily, -6); DayH6I = LastValue (DayH6,1); // Six
days before high
DayL6= TimeFrameGetPrice("L", inDaily, -6); DayL6I = LastValue (DayL6,1); // Six
days before low
DayH7= TimeFrameGetPrice("H", inDaily, -7); DayH7I = LastValue (DayH7,1); //
Seven days before high
DayL7= TimeFrameGetPrice("L", inDaily, -7); DayL7I = LastValue (DayL7,1); //
Seven days before low
DayH8= TimeFrameGetPrice("H", inDaily, -8); DayH8I = LastValue (DayH8,1); // Eight
days before high
DayL8= TimeFrameGetPrice("L", inDaily, -8); DayL8I = LastValue (DayL8,1); //
Eight days before low
DayH9= TimeFrameGetPrice("H", inDaily, -9); DayH9I = LastValue (DayH9,1); // Nine
days before high
DayL9= TimeFrameGetPrice("L", inDaily, -9); DayL9I = LastValue (DayL9,1); // Nine
days before low
DayH10= TimeFrameGetPrice("H", inDaily, -10); DayH10I = LastValue (DayH10,1); //
Ten days before high
DayL10= TimeFrameGetPrice("L", inDaily, -10); DayL10I = LastValue (DayL10,1); //
Ten days before low

TenDHLAvg= ( (DayH - DayL)+ (DayH2 -DayL2)+ (DayH3 - DayL3)+ (DayH4 - DayL4)+


(DayH5 - DayL5)+ (DayH6 -DayL6)+ (DayH7 - DayL7)+ (DayH8 - DayL8)+ (DayH9 - DayL9)+
(DayH10 -DayL10) )/10;

Buy= C>((DayC)+((.382)*(TenDHLAvg)));
Sell= C<((DayC)-((.382)*(TenDHLAvg)));
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

Short=Sell;

Cover=Buy;

BuyPrice=ValueWhen(Buy,C);

SellPrice=ValueWhen(Sell,C);

ShortPrice=ValueWhen(Short,C);

CoverPrice=ValueWhen(Cover,C);

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(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);

PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);

PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

SetPositionSize(300,spsShares);
ApplyStop(0,1,10,1);
//-----------end--------------
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy);

BuyPrice=ValueWhen(Buy,C);
SellPrice=ValueWhen(Sell,C);

Edc=(
WriteIf (Buy AND Ref(shrt,-1), " BUY at "+C+" ","")+
WriteIf (Sell AND Ref(Long,-1), " SEll at "+C+" ","")
);
_SECTION_END();

trendup = IIf(C>((DayC)+((.382)*(TenDHLAvg))), colorBlue, colorWhite);


trendcolor = IIf(C<((DayC)-((.382)*(TenDHLAvg))), colorRed, trendup);
Plot( C, "Close", trendcolor, styleCandle | styleThick );

numbars = LastValue(Cum(Status("barvisible")));
hts = -33.5;

// Volatility Levels //
TenDHLAvg1= ( (DayH - DayL) )/2;

DayM= (DayH - TenDHLAvg1);

YH = DayH; YHI = LastValue (YH,1); //


Yesterday High
YL = DayL; YLI = LastValue (YL,1); //
Yesterday Low

DC = DayC; DCI = LastValue (DC,1); //


Yesterday Close
BY = ((DayC)+((.382)*(TenDHLAvg))); BYI = LastValue (BY,1); // Buy
Entry Line

BY1 = ((DayM)+((.382)*(TenDHLAvg1))); BY1I = LastValue (BY1,1); // Buy


Entry Line
SH1 = ((DayM)-((.382)*(TenDHLAvg1))); SH1I = LastValue (SH1,1); // Sell
Entry Line

BT1 = ((DayC)+((.618)*(TenDHLAvg))); BT1I = LastValue (BT1,1); // Buy


Target Line 1
BT2 = ((DayC)+((.786)*(TenDHLAvg))); BT2I = LastValue (BT2,1); // Buy
Target Line 2
BT3 = ((DayC)+(TenDHLAvg)); BT3I = LastValue (BT3,1); // Buy
Target Line 3
BT4 = ((DayC)+((1.27)*(TenDHLAvg))); BT4I = LastValue
(BT4,1); // Againts Trend Sell S/L
SH = ((DayC)-((.382)*(TenDHLAvg))); SHI = LastValue (SH,1); // Sell Entry
Line
ST1 = ((DayC)-((.618)*(TenDHLAvg))); ST1I = LastValue (ST1,1); // Sell
Target Line 1
ST2 = ((DayC)-((.786)*(TenDHLAvg))); ST2I = LastValue (ST2,1); // Sell
Target Line 2
ST3 = ((DayC)-(TenDHLAvg)); ST3I = LastValue (ST3,1); // Sell
Target Line 3
ST4=((DayC)-((1.27)*(TenDHLAvg))); ST4I = LastValue
(ST4,1); // Againts Trend buy S/L
vvl = ParamToggle("Trend Levels","Hide|Show",1);
if(vvl==1) {

BY1 = ((DayM)+((.7)*(TenDHLAvg1))); BY1I = LastValue (BY1,1); // Buy


Entry Line
SH1 = ((DayM)-((.7)*(TenDHLAvg1))); SH1I = LastValue (SH1,1); // Sell
Entry Line

Plot(YH, "YH",colorLightYellow,styleLine|styleLine|styleNoRescale|styleNoTitle);
Plot(YL, "YL",colorLightYellow,styleLine|styleLine|styleNoRescale|styleNoTitle);
Plot(DC, "DC",colorWhite,styleDots|styleLine|styleNoRescale|styleNoTitle);
Plot(BY, "BY",colorLime,styleDashed|styleLine|styleNoRescale|styleNoTitle);
Plot(BT1, "BT1",colorGreen,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(BT2, "BT2",colorGreen,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(BT3, "BT3",colorRed,styleDashed|styleNoRescale|styleNoTitle);
Plot(BT4, "Sell",colorRed,styleDots|styleLine|styleNoRescale|styleNoTitle);
Plot(SH, "SH",colorRed,styleDashed|styleLine|styleNoRescale|styleNoTitle);
Plot(ST1, "ST1",colorRed,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(ST2, "ST2",colorRed,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(ST3, "ST3",colorLime,styleDashed|styleNoRescale|styleNoTitle);
Plot(ST4, "Buy",colorGreen,styleDots|styleLine|styleNoRescale|styleNoTitle);

PlotText(" YH ", LastValue(BarIndex())-(numbars/Hts), DCI, colorDarkGrey);


PlotText(" YL ", LastValue(BarIndex())-(numbars/Hts), DCI, colorDarkGrey);

PlotText(" DC ", LastValue(BarIndex())-(numbars/Hts), DCI, colorDarkGrey);


PlotText(" Buy & TGT3 of Againts Trend Sell" , LastValue(BarIndex())-
(numbars/Hts), BYI, colorLime);
PlotText(" Target1 & TGT2 of Againts Trend Sell" , LastValue(BarIndex())-
(numbars/Hts), BT1I, colorGreen);
PlotText(" Target2 & TGT1 of Againts Trend Sell " , LastValue(BarIndex())-
(numbars/Hts), BT2I, colorGreen);
PlotText(" Target3 & Againts Trend Sell" , LastValue(BarIndex())-
(numbars/Hts), BT3I, colorRed);
PlotText(" Againts Trend Sell S/L " , LastValue(BarIndex())-(numbars/Hts),
BT4I, colorRed);
PlotText(" Sell & TGT3 of Againts Trend Buy" , LastValue(BarIndex())-
(numbars/Hts), SHI, colorRed);
PlotText(" Target1 & TGT2 of Againts Trend Buy" , LastValue(BarIndex())-
(numbars/Hts), ST1I, colorRed);
PlotText(" Target2 & TGT1 of Againts Trend Buy" , LastValue(BarIndex())-
(numbars/Hts), ST2I, colorRed);
PlotText(" Target3 & Againts Trend Buy" , LastValue(BarIndex())-(numbars/Hts),
ST3I, colorLime);
PlotText(" Againts Trend Buy S/L " , LastValue(BarIndex())-(numbars/Hts),
ST4I, colorGreen);
}

Plot( EMA( Close,75),"55 EMA", colorGreen,styleLine|styleNoLabel);


Plot( EMA( Close,150),"55 EMA", colorRed,styleLine|styleNoLabel);

Plot( EMA( Close,300),"55 EMA", colorYellow,styleLine|styleNoLabel);

Das könnte Ihnen auch gefallen