You are on page 1of 5

_SECTION_BEGIN("jmoney2");

SetChartOptions(0,chartShowArrows|chartShowDates);
GraphXSpace=Param("GraphXSpace",-30,0,100,1);
dec = (Param("Decimals",2,0,7,1)/10)+1;
SetChartBkColor(ParamColor("Outer Panel", colorBlack));
SetChartBkGradientFill(ParamColor("Upper Chart", colorDarkGrey), ParamColor("Low
er Chart", colorDarkGrey));
Title = EncodeColor(55)+ Title = Name() + " " + EncodeColor(32) + Date() +
" " + EncodeColor(5) + "{{INTERVAL}} " +
EncodeColor(55)+ " Open = "+ EncodeColor(52)+ WriteVal(O,dec) +
EncodeColor(55)+ " High = "+ EncodeColor(5) + WriteVal(H,dec) +
EncodeColor(55)+ " Low = "+ EncodeColor(32)+ WriteVal(L,dec) +
EncodeColor(55)+ " Close = "+ EncodeColor(7)+ WriteVal(C,dec)+
EncodeColor(55)+ " Volume = "+ EncodeColor(11)+ WriteVal(V,1);

////////////////////////////

////////////////////////////

colorHighliter = IIf(C >= O, ColorRGB(0, 128, 0), ColorRGB(128, 0, 0));


//Demand Point
colorDemandPoint = ParamColor("Demand Line", ColorRGB(0, 128, 255));
DemandPoint = (Ref(L, -1) < Ref(L, -2)) & (L < Ref(L, -1)) & (L < Ref(L, 1)) & (
Ref(L, 1) < Ref(L, 2));
//Supply Point
colorSupplyPoint = ParamColor("Supply Line", ColorRGB(255, 128, 0));
SupplyPoint = (Ref(H, -1) > Ref(H, -2)) & (H > Ref(H, -1)) & (H > Ref(H, 1)) & (
Ref(H, 1) > Ref(H, 2));
CountTrendBars = 0;
CurrentBar = BarCount - 1;
dx0 = dx1 = dy0 = dy1 = 0;
sx0 = sx1 = sy0 = sy1 = 0;
for (i = 0; i < BarCount; i++) {
CurrentBar = (BarCount - 1) - i;
if (DemandPoint[CurrentBar]) {
if (dx1 == 0 & dy1 == 0) {
dx1 = CurrentBar;
dy1 = L[CurrentBar];
} else {
dx0 = CurrentBar;
dy0 = L[CurrentBar];
}
if (dx0 != 0 & dx1 != 0 & dy0 != 0 & dy1 != 0) {
if (dy0 < dy1) {
a = (-dy0 + dy1) / (-dx0 + dx1);
b = dy0 - dx0 * a;
for (j = dx1; j < BarCount; j++) {
if (j != dx1) {
y2 = a * j + b;
if (C[j] < y2) {
dy1 = y2;
dx1 = j;
colorHighliter[j] = Colo
rRGB(128, 0, 128);
CountTrendBars[j] = dx1
- dx0 - 1;
break;
}
}
}
if (dy1 != y2) {
dy1 = y2;
dx1 = BarCount - 1;
}
//Plot(LineArray(dx0, dy0, dx1, dy1, 0), "", col
orDemandPoint, styleLine, Null, Null, 0, 0, 2);
}
dx1 = dx0;
dy1 = dy0;
dx0 = dy0 = 0;
}
}
if (SupplyPoint[CurrentBar]) {
if (sx1 == 0 & sy1 == 0) {
sx1 = CurrentBar;
sy1 = H[CurrentBar];
} else {
sx0 = CurrentBar;
sy0 = H[CurrentBar];
}
if (sx0 != 0 & sx1 != 0 & sy0 != 0 & sy1 != 0) {
if (sy0 > sy1) {
a = (-sy0 + sy1) / (-sx0 + sx1);
b = sy0 - sx0 * a;
for (j = sx1; j < BarCount; j++) {
if (j != sx1) {
y2 = a * j + b;
if (C[j] > y2) {
sy1 = y2;
sx1 = j;
colorHighliter[j] = Colo
rRGB(128, 128, 0);
CountTrendBars[j] = sx1
- sx0 - 1;
break;
}
}
}
if (sy1 != y2) {
sy1 = y2;
sx1 = BarCount - 1;
}
//Plot(LineArray(sx0, sy0, sx1, sy1, 0), "", col
orSupplyPoint, styleLine, Null, Null, 0, 0, 2);
}
sx1 = sx0;
sy1 = sy0;
sx0 = sy0 = 0;
}
}
}
//Price
SetBarFillColor(colorHighliter);
Plot(C, "Close", IIf(colorHighliter == ColorRGB(128, 0, 128), ColorRGB(255, 0, 2
55), IIf(colorHighliter == ColorRGB(128, 128, 0), ColorRGB(255, 255, 0), IIf(C >
O, ColorRGB(0, 255, 0), IIf(C < O, ColorRGB(255, 0, 0), ColorRGB(255, 255, 255)
)))), styleCandle, Null, Null, 0, 0, 1);

////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////
FS=Param("MM Price Font Size",20,11,100,1);
Hor=Param("MM Price Horizontal Position",840,1,1200,1);
Ver=Param("MM price Vertical Position",10,1,830,1);
GfxSelectFont("tahoma", FS, 700, True );
GfxSetBkMode( 1 );
GfxSetTextColor( colorLime);
GfxTextOut(""+C, Hor+29 , Ver);
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("tahoma", 11, 700, True );
GfxSetBkMode( 1 );
GfxSetTextColor(7);
GfxTextOut(""+DD+" ("+xx+"%)", Hor+29 , Ver+29 );
//////////////////////////////////////////////////////////

sr=ParamToggle("Plot Supp/Res lines","No|Yes" ,1);


Per=Param("Sensitivity",0.65,0.5,5,0.5);
g=Param("No.of Lines",5,1,5,1);
x=Cum(1);
Pk1=PeakBars(H,per,1)== 0;
Tk1=TroughBars(L,per,1)== 0;
px1=LastValue(ValueWhen(pk1,x,1));
px2=LastValue(ValueWhen(Pk1,x,2));
px3=LastValue(ValueWhen(Pk1,x,3));
px4=LastValue(ValueWhen(pk1,x,4));
px5=LastValue(ValueWhen(Pk1,x,5));
tx1=LastValue(ValueWhen(Tk1,x,1));
tx2=LastValue(ValueWhen(Tk1,x,2));
tx3=LastValue(ValueWhen(Tk1,x,3));
tx4=LastValue(ValueWhen(Tk1,x,4));
tx5=LastValue(ValueWhen(Tk1,x,5));
XT1 =LastValue(ValueWhen(pk1,H,1));XT1c =LastValue(ValueWhen(pk1,Max(C,O),1));
XT2 =LastValue(ValueWhen(Pk1,H,2));XT2c =LastValue(ValueWhen(pk1,Max(C,O),2));
XT3 =LastValue(ValueWhen(Pk1,H,3));XT3c =LastValue(ValueWhen(pk1,Max(C,O),3));
XT4 =LastValue(ValueWhen(pk1,H,4));XT4c =LastValue(ValueWhen(pk1,Max(C,O),4));
XT5 =LastValue(ValueWhen(Pk1,H,5));XT5c =LastValue(ValueWhen(pk1,Max(C,O),5));
YT1 =LastValue(ValueWhen(tk1,L,1));YT1c =LastValue(ValueWhen(tk1,Min(O,C),1));
YT2 =LastValue(ValueWhen(tk1,L,2));YT2c =LastValue(ValueWhen(tk1,Min(O,C),2));
YT3 =LastValue(ValueWhen(tk1,L,3));YT3c =LastValue(ValueWhen(tk1,Min(O,C),3));
YT4 =LastValue(ValueWhen(tk1,L,4));YT4c =LastValue(ValueWhen(tk1,Min(O,C),4));
YT5 =LastValue(ValueWhen(tk1,L,5));YT5c =LastValue(ValueWhen(tk1,Min(O,C),5));
pk1=IIf(x>px1 AND g>=1 AND sr,XT1,Null);pk1c=IIf(x>px1 AND g>=1 AND sr,XT1c,Null
);
Col1=IIf( LastValue(C)>pk1, ColorRGB(14,14,100), ColorRGB(180,20,20) );
Plot(pk1,"",31,1);PlotOHLC(0,pk1,pk1c,0,"",Col1,styleCloud|styleNoLabel,Null, Nu
ll, Null, -1);
pk2=IIf(x>px2 AND g>=2 AND sr,XT2,Null);pk2c=IIf(x>px2 AND g>=2 AND sr,XT2c,Null
);
Col2=IIf( LastValue(C)>pk2, ColorRGB(24,24,120), ColorRGB(180,40,40) );
Plot(pk2,"",31,1);PlotOHLC(0,pk2,pk2c,0,"",Col2,styleCloud|styleNoLabel,Null, Nu
ll, Null, -2);
pk3=IIf(x>px3 AND g>=3 AND sr,XT3,Null);pk3c=IIf(x>px3 AND g>=3 AND sr,XT3c,Null
);
Col3=IIf( LastValue(C)>pk3, ColorRGB(34,34,140),ColorRGB(180,60,60));
Plot(pk3,"",31, 1);PlotOHLC(0,pk3,pk3c,0,"",Col3,styleCloud|styleNoLabel,Null, N
ull, Null, -3);
pk4=IIf(x>px4 AND g>=4 AND sr,XT4,Null);pk4c=IIf(x>px4 AND g>=4 AND sr,XT4c,Null
);
Col4=IIf( LastValue(C)>pk4, ColorRGB(44,44,160), ColorRGB(180,80,80));
Plot(pk4,"",31,1);PlotOHLC(0,pk4,pk4c,0,"",Col4,styleCloud|styleNoLabel,Null, Nu
ll, Null, -4);
pk5=IIf(x>px5 AND g>=5 AND sr,XT5,Null);pk5c=IIf(x>px5 AND g>=5 AND sr,XT5c,Null
);
Col5=IIf( LastValue(C)>pk5, ColorRGB(54,54,180), ColorRGB(180,100,100));
Plot(pk5,"",31,1);PlotOHLC(0,pk5,pk5c,0,"",Col5,styleCloud|styleNoLabel,Null, Nu
ll, Null, -5);
tl1=IIf(x>tx1 AND g>=1 AND sr,YT1,Null);tl1c=IIf(x>tx1 AND g>=1 AND sr,YT1c,Null
);
Col1=IIf( LastValue(C)>tl1, ColorRGB(14,14,100), ColorRGB(180,20,20) );
Plot(tl1,"",1,1);PlotOHLC(0,tl1,tl1c,0,"",Col1,styleCloud|styleNoLabel,Null, Nul
l, Null, -1);
tl2=IIf(x>tx2 AND g>=2 AND sr,YT2,Null);tl2c=IIf(x>tx2 AND g>=2 AND sr,YT2c,Null
);
Col2=IIf( LastValue(C)>YT2, ColorRGB(24,24,120), ColorRGB(180,40,40));
Plot(tl2,"",1,1);PlotOHLC(0,tl2,tl2c,0,"",Col2,styleCloud|styleNoLabel,Null, Nul
l, Null, -2);
tl3=IIf(x>tx3 AND g>=3 AND sr,YT3,Null);tl3c=IIf(x>tx3 AND g>=3 AND sr,YT3c,Null
);
Col3=IIf( LastValue(C)>YT3, ColorRGB(34,34,140), ColorRGB(180,60,60) );
Plot(tl3,"",1,1);PlotOHLC(0,tl3,tl3c,0,"",Col3,styleCloud|styleNoLabel,Null, Nul
l, Null, -3);
tl4=IIf(x>tx4 AND g>=4 AND sr,YT4,Null);tl4c=IIf(x>tx4 AND g>=4 AND sr,YT4c,Null
);
Col4=IIf( LastValue(C)>YT4, ColorRGB(44,44,160), ColorRGB(180,80,80) );
Plot(tl4,"",1,1);PlotOHLC(0,tl4,tl4c,0,"",Col4,styleCloud|styleNoLabel,Null, Nul
l, Null, -4);
tl5=IIf(x>tx5 AND g>=5 AND sr,YT5,Null);tl5c=IIf(x>tx5 AND g>=5 AND sr,YT5c,Null
);
Col5=IIf( LastValue(C)>YT5, ColorRGB(54,54,180), ColorRGB(180,100,100));
Plot(tl5,"",1,1);PlotOHLC(0,tl5,tl5c,0,"",Col5,styleCloud|styleNoLabel,Null, Nul
l, Null, -5);
GfxSetOverlayMode(1);
GfxSetTextColor(10);
GfxSelectFont("Old English Text MT", 12, 300, False, False, 0);
GfxTextOut(" we are ", Status("pxwidth")-60 , Status("pxheight")-20 );
_SECTION_END();
_SECTION_BEGIN("ema_crossover");
x = EMA(Close,20);
y = EMA(Close,50);
Plot(EMA(Close,20),"",colorRed,styleLine);
Plot(EMA(Close,50),"",colorBrightGreen,styleLine );
Plot(EMA(Close,100),"",colorWhite,styleLine );

Buy=Cross(x,y);
PlotShapes(shapeUpArrow*Buy,colorGreen,0,L, Offset=-50);

Sell=Cross(y,x);
PlotShapes(shapeDownArrow*Sell,colorRed,0,H, Offset=-50);
AlertIf( Sell, "SOUND C:\\Windows\\Media\\chord.wav", "Audio alert", 2 );

_SECTION_END();

You might also like