Murray Maths With Patterns Modified Intraday
Murray Maths With Patterns Modified Intraday
Murray Maths With Patterns Modified Intraday
up=Study("UP",GetChartID());
dm=Study("DN",GetChartID());
Color=IIf(C>O,colorGreen,colorRed);
//Graph0=Close; Graph0Color=1; Graph0Style=64;
Plot(C,"close",color,styleBar);
if (Type=="Intraday")
{
if(I>1)
{
if(dn[i]!=dn[i-1])
{
Lo=L[i];
Hi=H[i];
}
}
if (L[i]<Lo)Lo=L[i];
if (H[i]>Hi)Hi=H[i];
}
else if (type=="Rolling")
{
Hi=Hix[i];
Lo=Lox[i];
}
if (up[i]>hi)Hi=up[i];
if (dm[i]<lo)Lo=dm[i];
//PlotText(WriteVal(Lo,1.0),colorWhite,i,H[i]+15);
Max_1 = IIf( (Min_1 + Oct) > Hi, Min_1 + Oct, Min_1 + 2*Oct ) ;
/******************************/
H2 = IIf( (Min_2 - 1/8*Diff) <= Lo AND Hi <= (5/8*Diff + Min_2) AND H1==0,
Min_2 + 1/2*Diff, 0) ;
H4 = IIf( (Min_2 + 3/8*Diff) <= Lo AND Hi <= (Min_2 + 9/8*Diff) AND H3==0,
Max_2, 0 ) ;
H5 = IIf( (Min_2 + 1/8*Diff)<=Lo AND Hi <= (Min_2 + 7/8*Diff) AND H1==0 AND H2==0
AND H3==0 AND H4==0,
Min_2 + 3/4*Diff , 0 ) ;
H6 = IIf( ( H1 + H2 + H3 + H4 + H5 ) == 0, Max_2, 0 ) ;
/**************************/
L2 = IIf(H2>0, Min_2, 0) ;
L6 = IIf(H6>0, Min_2, 0 ) ;
M_8 = ( H1 + H2 + H3 + H4 + H5 + H6 ) ;
M_0 = ( L1 + L2 + L3 + L4 + L5 + L6 ) ;
/**************************************/
Line0[i] = M_0 ;
Line8[i] = M_8 ;
Plot(Line0,"Line0",6,styleLine);//0/8
Plot(Line1,"Line1",7,styleLine);//1/8
Plot(Line2,"Line2",4,styleLine);//2/8
Plot(Line3,"Line3",5,styleLine|styleDashed);//3/8
Plot(Line4,"Line4",6,styleLine);//4/8
Plot(Line5,"Line5",5,styleLine|styleDashed);//5/8
Plot(Line6,"Line6",4,styleLine);//6/8
Plot(Line7,"Line7",7,styleLine);//7/8
Plot(Line8,"Line8",6,styleLine);//8/8
Plot(Lineplus2,"Lineplus2",4,styleLine);//+2/8
Plot(Lineminus2,"Lineminus2",4,styleLine);//-2/8
/**************************************************************/
Title = Date()+" Murray Maths "+ Interval(format=2)+" "+Name()+" O
"+WriteVal(O,1.2)+" H "+WriteVal(H,1.2)+" L "+WriteVal(L,1.2)+" C "+
WriteVal(C,1.2)+" "+EncodeColor(colorYellow)+" Dayhigh "
+WriteVal(Hi,1.2)+" Daylow "+WriteVal(Lo,1.2)
+"\n"+EncodeColor(colorGreen)+"Upper Breakout "+EncodeColor(colorRed)
+WriteVal(Lineplus2,1.2)+EncodeColor(colorGreen)
+" Resistance 8/8 "+EncodeColor(colorBlue)
+WriteVal(Line8,1.2)+EncodeColor(colorGreen)+" Reversal 7/8
"+EncodeColor(colorYellow)
+WriteVal(Line7,1.2)
+"\n"+EncodeColor(colorYellow)+"Middle S/R 4/8 "+EncodeColor(colorBlue)
+WriteVal(Line4,1.2)
+"\n"+EncodeColor(colorRed)+"Lower Breakout "+EncodeColor(colorRed)
+WriteVal(Lineminus2,1.2)+EncodeColor(colorRed)+" Support 0/8 "
+EncodeColor(colorBlue)+WriteVal(Line0,1.2)+EncodeColor(colorRed)
+" Reversal 1/8 "+EncodeColor(colorYellow)+WriteVal(Line1,1.2);
/*
Title = Name()
+ "=" + WriteIf( round(C)== C, NumToStr(C,1) , WriteVal(C) ) + " " + "\\c17"
+ WriteIf( Interval()==86400, "Daily ", WriteIf(Interval()==3600,"Hourly ",
WriteIf(Interval()==900,"15 Min ", WriteIf(Interval()==300,"5 Min ",
WriteIf(Interval()==60,"1 Min ", "" ) ) ) ) )
+ Date() + "\\c12" + WriteIf(Volume>0," Turnover=","")
+ WriteIf(Volume>0, WriteVal(Volume*Close/1000), "" ) ;
*/
Filter = 1 ;
AddColumn(Lineminus2,"Limit1",1.2);
AddColumn(IIf(C>Lineminus2 AND C<Line0,C,Null),"Close",1.2, Null);
AddColumn(Line0,"Supp1",1.2);
AddColumn(IIf(C>Line0 AND C<Line1,C,Null),"Close",1.2, Null);
AddColumn(Line1,"Reversal1",1.2);
AddColumn(IIf(C>Line1 AND C<Line2,C,Null),"Close",1.2, Null);
AddColumn(Line2,"Trend",1.2);
AddColumn(IIf(C>Line2 AND C<Line3,C,Null),"Close",1.2, Null);
AddColumn(Line3,"Short",1.2);
AddColumn(IIf(C>Line3 AND C<Line4,C,Null),"Close",1.2, Null);
AddColumn(Line4,"Supp/Res",1.2);
AddColumn(IIf(C>Line4 AND C<Line5,C,Null),"Close",1.2, Null);
AddColumn(Line5,"Long",1.2);
AddColumn(IIf(C>Line5 AND C<Line6,C,Null),"Close",1.2, Null);
AddColumn(Line6,"Trend",1.2);
AddColumn(IIf(C>Line6 AND C<Line7,C,Null),"Close",1.2, Null);
AddColumn(Line7,"Reversal2",1.2);
AddColumn(IIf(C>Line7 AND C<Line8,C,Null),"Close",1.2, Null);
AddColumn(Line8,"Res2",1.2);
AddColumn(IIf(C>Line8 AND C<Lineplus2,C,Null),"Close",1.2, Null);
AddColumn(Lineplus2,"Limit2",1.2);
_SECTION_BEGIN("Pattern Recognition");
SetChartOptions(0,chartShowArrows|chartShowDates);
// Plot( C, "Close", ParamColor("Color", colorWhite ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() );
showpatterns=ParamList("Show Patterns","No|Yes");
ind=0;
O1 = Ref(O,-1);O2 = Ref(O,-2);O3 = Ref(O,-3);O4 = Ref(O,-4);
H1 = Ref(H,-1);H2 = Ref(H,-2);H3 = Ref(H,-3);H4 = Ref(H,-4);
L1 = Ref(L,-1);L2 = Ref(L,-2);L3 = Ref(L,-3);L4 = Ref(L,-4);
C1 = Ref(C,-1);C2 = Ref(C,-2);C3 = Ref(C,-3);C4 = Ref(C,-4);
MA13=MA(C,10);MA134=Ref(MA(C,15),-4);
Plot(MA13,"MA13",colorBlue,styleNoTitle|styleNoLabel);
m=0;n=0;Dayx=0;z=0;
if (showpatterns=="Yes")
{
for (i=1;i<BarCount-1;i++)
{
if (i>2)
{
//Bullish Kicking
if(C[i]>O[i] AND ((C[i]-O[i])/(.001+H[i]-L[i])>.6)
AND (H[i]-C[i]<0.2*(H[i]-L[i])) AND (O[i]-
L[i]<0.2*(H[i]-L[i]))
AND C1[i]<O1[i] AND ((o1[i]-c1[i])/(.001+H1[i]-
L1[i])>.6)
AND (H1[i]-O1[i]<0.2*(H1[i]-L1[i])) AND
(C1[i]-L1[i]<0.2*(H1[i]-L1[i]))
AND O[i]>o1[i] )
{
n=i;ind[i]=1;
PlotText("BullKik",i,L[i]-10,colorGreen);
}
//Bullish Abandoned Baby
if ((C1[i] == O1[i])
AND (O2[i]>C2[i]) AND ((O2[i]-C2[i])/(.001+H2[i]-L2[i])>.6)
AND (C[i]>O[i])
AND (L2[i]>H1[i])
AND (L[i]>H1[i])
AND MA13[i]-MA134[i]<0)
{
n=i;ind[i]=1;
PlotText("BullABBABY",i,L[i]-10,colorGreen);
}
{
n=i;ind[i]=1;
PlotText("3InsideUp",i,L[i]-10,colorGreen);
}
//3 Outside up
if ((O2[i]>C2[i]) AND ((O2[i]-c2[i])/(.001+H2[i]-L2[i])>.6)
AND (C1[i]>O1[i])
AND (C1[i]>= O2[i])
AND (C2[i]>= O1[i])
AND ((C1[i]-O1[i])>(O2[i]-C2[i]))
AND (C[i]>O[i])
AND (C[i]>C1[i])
AND MA13[i]-MA134[i]<0)
{
n=i;ind[i]=1;
PlotText("3OutsideUp",i,L[i]-10,colorGreen);
}
//3 White soldiers
if ((C[i]>O[i]) AND ((C[i]-O[i])/(.001+H[i]-L[i])>.6)
AND (C1[i]>O1[i]) AND ((C[i]-O[i])/(.001+H[i]-L[i])>.6)
AND (C2[i]>O2[i]) AND ((C[i]-O[i])/(.001+H[i]-
L[i])>.6)
AND (C[i]>C1[i]) AND (C1[i]>C2[i]) AND
(O[i]<C1[i])
AND (O[i]>O1[i]) AND (O1[i]<C2[i]) AND
(O1[i]>O2[i])
AND (((H[i]-C[i])/(H[i]-L[i]))<.2)
AND (((H1[i]-C1[i])/(H1[i]-
L1[i]))<.2)
AND (((H2[i]-C2[i])/
(H2[i]-L2[i]))<.2)
AND MA13[i]-
MA134[i]<0 )
{
n=i;ind[i]=1;
PlotText("3WhtSoldiers",i,L[i]-10,colorGreen);
}
//Bullish Concealing Baby Swallow
if (O[i]>C[i] AND O1[i]>C1[i] AND O2[i]>C2[i] AND O3[i]>C3[i]
AND (H[i]==O[i] AND L[i]==C[i]) AND
(H2[i]==O2[i] AND L2[i]==C2[i]) AND
(H3[i]==O3[i] AND L3[i]==C3[i])
AND ((O3[i]-C3[i])/(.001+H3[i]-L3[i])>.6)
AND ((O2[i]-C2[i])/(.001+H2[i]-L2[i])>.6)
AND (((H1[i]-L1[i])>3*(O1[i]-C1[i])) AND
((H1[i]-C1[i])/(.001+H1[i]-L1[i])>0.6)
AND
((H1[i]-O1[i])/(.001+H1[i]-
L1[i])>0.6))
AND (O2[i]<O3[i] AND C2[i]<C3[i] AND
O1[i]<C2[i])
AND (H1[i]< O[i] AND L1[i]>C[i]))
{
n=i;ind[i]=1;
PlotText("ConcBABYSWL",i,L[i]-10,colorGreen);
}
//moderate reversal indicators
//Bullish Dragonfly Doji
if (O[i]==C[i] AND H[i]==C[i]
AND ((H[i]-L[i])/(.001+H[i]-L[i])>.6)
AND MA13[i]-MA134[i]<0 )
{
n=i;ind[i]=1;
PlotText("BullDoji",i,L[i]-10,colorGreen);
}
// bullish long legged Doji
if (abs(O[i]-C[i])<0.15*(H[i]-L[i])
AND abs(O[i]-(H[i]+L[i])/2)<0.2*(H[i]-L[i])
AND C[i]<C1[i] AND C1[i]<C2[i] AND C2[i]<C3[i] )
{
n=i;ind[i]=1;
PlotText("BullLLDoji",i,L[i]-10,colorGreen);
}
//Gravestone Doji
if (L[i]==O[i] AND L[i]==C[i]
AND ((H[i]-L[i])/(.001+H[i]-L[i])>.6)
AND O1[i]<C1[i] AND ((H1[i]-L1[i])/(.001+H1[i]-
L1[i])>.6)
AND (C1[i]-C[i])<0.2*(H[i]-L[i]))
{
n=i;ind[i]=1;
PlotText("GRaveStnDoji!!!",i,L[i]-10,colorGreen);
}
//Doji Star
if (O[i]==C[i] AND O1[i]==C1[i] AND O2[1]==C2[i]
AND O1[i]<C2[i] AND O1[i]<C[i]
AND MA13[i]-MA134[i]<0 )
{
n=i;ind[i]=1;
PlotText("Doji*",i,L[i]-10,colorGreen);
}
//Bullish Mat Hold
if (C4[i]>O4[i] AND ((C4[i]-O4[i])/(.001+H4[i]-L4[i])>.6)
AND (C3[i]>C4[i]) AND O3[i]>C3[i] AND H3[i]-L3[i]>3*(O3[i]-
C3[i])
AND (C2[i]<C3[i] OR O2[i]<C3[i]) AND H2[i]-
L2[i]>3*abs((O2[i]-C2[i]))
AND (C1[i]<C2[i] OR C1[i]<O2[i]) AND
O1[i]>C1[i] AND H1[i]-L1[i]>3*(O1[i]-C1[i])
AND (H[i]>H3[i]) AND C[i]>O[i] AND
((C[i]-O[i])/(.001+H[i]-L[i])>.6))
{
n=i;ind[i]=1;
PlotText("BullMathold",i,L[i]-10,colorGreen);
}