Traderji.com


Price Action perspective using VWAP+SD and TF AMAs

Discuss Price Action perspective using VWAP+SD and TF AMAs at the Advanced Trading Strategies within the Traderji.com; AMA Then to get the different TF perspective I use 5AMA (golden) and 15AMA (lavender ...


Go Back   Traderji.com > METHODS & STRATEGIES > Advanced Trading Strategies


Advanced Trading Strategies Discuss Advanced Trading Systems & Strategies.


Reply
 
Thread Tools
  #11  
Old 7th February 2016, 07:33 PM
Member
 
Join Date: Sep 2013
Location: mumbai
Posts: 2,219
Thanks: 936
Thanked 8,749 Times in 2,102 Posts
pratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
pratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

AMA

Then to get the different TF perspective I use 5AMA (golden) and 15AMA (lavender with red border) that is AMA of 5min TF and AMA of 15min TF

this gives a kind of multi TF play view



Advertisements

Reply With Quote
The Following 7 Users Say Thank You to pratapvb For This Useful Post:
ankur07090 (7th February 2016), eku (7th February 2016), monkeybusiness (8th February 2016), novicetraders (8th February 2016), singsanjay09 (17th February 2016), TracerBullet (7th February 2016), vijkris (7th February 2016)
Advertisements
  #12  
Old 7th February 2016, 07:42 PM
Member
 
Join Date: Sep 2013
Location: mumbai
Posts: 2,219
Thanks: 936
Thanked 8,749 Times in 2,102 Posts
pratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
pratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

now when we combing the VWAP day perspective it reinforces the TF view or gives a perspetive whether to reverse or reenter or hold on etc


Last edited by pratapvb; 7th February 2016 at 09:59 PM.
Reply With Quote
The Following 9 Users Say Thank You to pratapvb For This Useful Post:
ankur07090 (7th February 2016), blackberry (7th February 2016), eku (7th February 2016), monkeybusiness (8th February 2016), novicetraders (8th February 2016), singsanjay09 (5th March 2016), thiruwins (7th February 2016), TracerBullet (8th February 2016), vijkris (7th February 2016)
  #13  
Old 7th February 2016, 07:49 PM
Member
 
Join Date: Sep 2013
Location: mumbai
Posts: 2,219
Thanks: 936
Thanked 8,749 Times in 2,102 Posts
pratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
pratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

AMA

generic version. This puts it for the chart TF. you can change to higher TF by using useTF and TF params. colors can be change to differentiate bands for visual feedback

Code:
datamode = ParamToggle("Data Mode", "No|Yes", 0) ;
showintitle = ParamToggle("Show in Title", "No|Yes", 0) ;
showlabel = ParamToggle("Show Label", "No|Yes", 1) ;

usetf = ParamToggle("Use TF", "No|Yes", 0) ;
tf = Param("TF", 6, 1, 100000, 1) ;
isexpandLast = ParamToggle("Expand Mode", "First|Last", 1) ;
expandmode = IIf(isexpandLast, expandLast, expandFirst) ;

period = Param("Period", 30, 1, 100, 1) ;
noiseperiod = Param("Noise Period", 5, 1, 100, 1) ;
Clr = ParamColor("AMA Color", colorLightOrange) ;
ClrClose = ParamColor("AMA Close Color", colorOrange) ;

MAwidthper = Param("MA Width %", 0.005, 0, 10, 1) ;
MAwidth = SelectedValue(C) * MAwidthper /100 ;
showasband = ParamToggle("Show as band", "No|Yes", 1) ;
Onlyclose = ParamToggle("Show Only Close", "No|Yes", 0) ;
showclosebias = ParamToggle("Show Close Bias", "No|Yes", 0) ;
Closebiasht = Param("Close bias Ht", 4, 0, 100) ;
Clrbiasup = ParamColor("Color Bias Up", colorSkyblue) ;
Clrbiasdn = ParamColor("Color Bias Down", colorRose) ;
Clrbiasnone = ParamColor("Color Bias None", colorLavender) ;

Clrband = ParamColor("Color Band", colorGold) ;
bandlevel = Param("Level Band", -1, -5, 5, 1) ;
tradearr = ParamToggle("Show Trade Arrow", "No|Yes", 0) ;
triggertypepvt = ParamToggle("Trigger Type", "Bar|Pvt", 0) ;
Onbody= ParamToggle("BO style", "H-L|Body", 1) ;

datamodestyle = styleNoRescale ;
if (NOT showintitle)
	datamodestyle |= styleNoTitle ;
if (NOT showlabel)
	datamodestyle |= styleNoLabel ;

if (datamode)
	datamodestyle = styleNoDraw|styleNoTitle|styleNoLabel|styleNoRescale ;

onlyClosestyle = 0 ;
if (Onlyclose)
	OnlyClosestyle = styleNoDraw ;

tfs = tf *in1Minute ;
if (usetf)
	TimeFrameSet(tfs) ;

tfma = int(Interval()/60) ;
if (usetf AND tfs >= Interval())
	tfma = tf ;

strtf = NumToStr(tfma, 8.0)+"min" ;

Refo = ParamField("TF Open", 0) ;
Refh = ParamField("TF High", 1) ;
Refl = ParamField("TF Low", 2) ;
Refc = ParamField("TF Close", 3) ;
//Refbi = ParamField("BI", 4) ;

//Plot(EMA( Close, period ), "", colorRed) ;
fast = 2/(2+1);
slow = 2/(period+1);
dir=abs(Refc -Ref(Refc ,-noiseperiod ));
vol=Sum(abs(Refc -Ref(Refc,-1)),noiseperiod );
ER=dir/vol;
sc =( ER*(fast-slow)+slow)^2; 
amaplotcx = AMA( Refc, sc ); 

dirh=abs(Refh -Ref(Refh ,-noiseperiod ));
volh=Sum(abs(Refh -Ref(Refh,-1)),noiseperiod );
ERh=dirh/volh;
sch =( ERh*(fast-slow)+slow)^2; 
amaplothx = AMA( Refh, sch ); 

dirl=abs(Refl -Ref(Refl ,-noiseperiod ));
voll=Sum(abs(Refl -Ref(Refl,-1)),noiseperiod );
ERl=dirl/voll;
scl =( ERl*(fast-slow)+slow)^2; 
amaplotlx = AMA( Refl, scl ); 

	amaplotc = amaplotcx ;
	amaploth = amaplothx ;
	amaplotl = amaplotlx ;

if (usetf)
{
	amaplotc = TimeFrameExpand(amaplotcx, tfs, expandmode) ;
	amaploth = TimeFrameExpand(amaplothx, tfs, expandmode) ;
	amaplotl = TimeFrameExpand(amaplotlx, tfs, expandmode) ;

	TimeFrameRestore() ;
}

	showoncrb = ParamToggle("Show On CRB", "No|Yes", 0) ;
	Refo = ParamField("CRB Open", 7+0) ;
	Refh = ParamField("CRB High", 7+1) ;
	Refl = ParamField("CRB Low", 7+2) ;
	Refc = ParamField("CRB Close", 7+3) ;
	Refbi = ParamField("CRB BI", 7+4) ;
	Refcrbbars = ParamField("CRB Bars", 7+5) ;
	Refnbars = ParamField("TF Bars", 7+6) ;
	Refdt = ParamField("CRB DT", 7+7) ;


	if (showoncrb)
	{
		diffbars = Refnbars -Refcrbbars -1 ;

		// convert to crb
		Refamaploth = Ref(amaploth, -diffbars) ;
		Refamaplotc = Ref(amaplotc, -diffbars) ;
		Refamaplotl = Ref(amaplotl, -diffbars) ;

//		RefClre = Ref(Clr, -diffbars) ;

		k = 0 ;
		for ( i = Crbst ; i < BarCount ; i++)
		{
			Refbar = Refbi[i];

			Refamaploth[i] = amaploth[Refbar] ;
			Refamaplotc[i] = amaplotc[Refbar] ;
			Refamaplotl[i] = amaplotl[Refbar] ;

//			RefClre[i] = Clr[Refbar];
			k++;
		}
	}
	else
	{
		Refamaploth = amaploth ;
		Refamaplotc = amaplotc ;
		Refamaplotl = amaplotl ;
//		RefClre = Clre ;
	}


Plot(Refamaplotc, strtf+"AMA close"+NumToStr(period, 1.0)+" "+ NumToStr(noiseperiod , 1.0), ClrClose, styleThick|datamodestyle) ;
Plot(Refamaploth, strtf+"AMA high"+NumToStr(period, 1.0)+" "+ NumToStr(noiseperiod , 1.0), Clr, styleThick|datamodestyle|OnlyClosestyle) ;
Plot(Refamaplotl, strtf+"AMA low"+NumToStr(period, 1.0)+" "+ NumToStr(noiseperiod , 1.0), Clr, styleThick|datamodestyle|OnlyClosestyle) ;
if (MAwidth > 0)
	PlotOHLC(Refamaplotc+MAwidth, Refamaplotc+MAwidth, Refamaplotc-MAwidth, Refamaplotc-MAwidth, "", ClrClose , styleCloud|styleNoLabel|datamodestyle) ;
if (showasband)
{
	PlotOHLC(Refamaploth, Refamaploth, Refamaplotl, Refamaplotl, "", Clrband, styleCloud|styleNoLabel|datamodestyle|OnlyClosestyle, 0, 0, 0, bandlevel) ;
}

if (showclosebias)
{
	upside = Refamaploth-(Refamaploth-Refamaplotl)/3 ;
	dnside = Refamaplotl+(Refamaploth-Refamaplotl)/3 ;

	up = Refamaplotc >= upside ;
	dn = Refamaplotc <= dnside ;

	Clr = IIf(up, Clrbiasup, IIf(dn, Clrbiasdn,Clrbiasnone)) ;

	Plot(Closebiasht, "", Clr, styleArea|styleNoLabel|styleOwnScale, 0, 100) ;
}

showparam = ParamToggle("Show Key Param", "No|Yes", 1) ;

if (showparam)
{
	y = (SelectedValue(Refamaploth)+ SelectedValue(Refamaplotl)) /2 ;
	tfsd = tfs ;
	if (tfsd < Interval())
		tfsd = Interval() ;

//	str = "TF="+NumToStr(tfsd/in1Minute, 1.0) + " P=" + NumToStr(period, 1.0)+"-"+ NumToStr(noiseperiod, 1.0);
	str = NumToStr(tfsd/in1Minute, 1.0) + " AMA" ;
	PlotText(str, BarCount+2, y, colorBlack) ;
}

showrib = ParamToggle("Show Ribbon", "No|Yes", 0) ;
barht = Param("Bar Ht", 4, 1, 100) ;

Refo = ParamField("Open", 0) ;
Refh = ParamField("High", 1) ;
Refl = ParamField("Low", 2) ;
Refc = ParamField("Close", 3) ;

if (showrib)
{
	Buy = Refc > Max(Refamaplotc, Refamaploth) ;
	Short = Refc < Min(Refamaplotc, Refamaplotl) ;

	up = Flip(Buy, Short) ;
	dn = Flip(Short, Buy) ;

	Clr = IIf(up, colorBlue, colorRed) ;

	Plot(barht, "", Clr, styleArea|styleNoLabel|styleOwnScale, 0, 100) ;
}

isemapvts = ParamToggle("Pvt Type", "H-L|EMA", 1) ;

if (tradearr)// AND NOT datamode)
{
avgP = (Refh+refl+Refc)/3 ;
p1 = Param("Fast", 1, 1, 100, 1) ;
p2 = Param("Slow", 3, 1, 100, 1) ;

ismph = H-H ;
ismpl = L-L ;
if (isemapvts)
{
EMA1 = EMA(avgP, p1) ;
EMA2 = EMA(avgP, p2) ;

upcross = Cross(EMA1, EMA2) ;
downcross = Cross(EMA2, EMA1) ;

bi = BarIndex() ; 

mphbar = HighestSinceBars(upcross, Refh) ;
mplbar = LowestSinceBars(downcross, Refl) ;

mphbi = ValueWhen(downcross, bi, 0) - ValueWhen(downcross, mphbar, 0) ;
ismph = mphbi == bi ;

mplbi = ValueWhen(upCross, bi, 0) - ValueWhen(upCross, mplbar, 0) ;
ismpl = mplbi == bi ;

ismph = IIf(downCross AND mphbar == 0, True, ismph) ;
ismpl = IIf(upcross AND mplbar == 0, True, ismpl) ;
}
else
{
	ismph = H >= Ref(H, -1) AND H > Ref(H, 1) ;
	ismpl = L <= Ref(L, -1) AND L < Ref(L, 1) ;
/*
	ismph = ExRem(ismph, ismpl) ;
	ismpl = ExRem(ismpl, ismph) ;
	isbmph = ExRem(isbmph, isbmpl) ;
	isbmpl = ExRem(isbmpl, isbmph) ;
*/

}


showminor = ParamToggle("Show Minor Pvts", "No|Yes", 1) ;
showminorlvls = ParamToggle("Show Minor Levels", "No|Yes", 1) ;

issquare = ParamToggle("Pvt style", "Circle|Square", 0) ;
pvtmarker = IIf(issquare, shapeSmallSquare, shapeSmallCircle) ;

if (showminor)
{
	PlotShapes(ismph*pvtmarker , colorRed, 0, Refh, 12) ;
	PlotShapes(ismpl*pvtmarker , colorGreen, 0, Refl, -12) ;
}

mph = ValueWhen(ismph, Refh) ;
mpl = ValueWhen(ismpl, Refl) ;

if (showminorlvls)
{
	x = LineArray(0, SelectedValue(mph), (BarCount-1), SelectedValue(mph));

	Plot(x, "", colorGold, styleDashed);

	x = LineArray(0, SelectedValue(mpl), (BarCount-1), SelectedValue(mpl));

	Plot(x, "", colorGold, styleDashed);
}


	Reflow = Refl ;
	Refhigh = Refh ;
	if (Onbody)
	{
		Reflow = Min(Refo, Refc) ;
		Refhigh = Max(Refo, Refc) ;
	}
	
	if (triggertypepvt)
	{
		Buy = ismph AND Refhigh > AMAploth ;
		Short = ismpl AND Reflow < AMAplotl ;
	}
	else
	{
		Buy = avgP > AMAploth ;
		Short = avgP < AMAplotl ;
	}

	Buy = ExRem(Buy, Short OR Refc < AMAploth ) ;
	Short = ExRem(Short, Buy OR Refc > AMAplotl ) ;

	Sell = (Refc < AMAploth AND NOT Refc  < AMAplotl AND Refl > AMAplotl) ;
	Cover = (Refc  > AMAplotl AND NOT Refc  > AMAploth AND Refh < AMAploth) ;

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

	PlotShapes(Buy*shapeUpTriangle, colorGreen, 0, Refh, 12) ;
	PlotShapes(Short*shapeDownTriangle, colorBrown, 0, Refl, 12) ;

	showsl = ParamToggle("Show SL", "No|Yes", 0) ;
	if (showsl)
	{
		PlotShapes(Cover*shapeSmallUpTriangle, colorBlack, 0, Refh, 12) ;
		PlotShapes(Sell*shapeSmallDownTriangle, colorBlack, 0, Refl, 12) ;
	}

}
Reply With Quote
The Following 8 Users Say Thank You to pratapvb For This Useful Post:
ankur07090 (7th February 2016), eku (7th February 2016), monkeybusiness (8th February 2016), novicetraders (8th February 2016), singsanjay09 (5th March 2016), TracerBullet (8th February 2016), vijkris (7th February 2016), zoheb (22nd March 2016)
  #14  
Old 7th February 2016, 07:52 PM
Member
 
Join Date: Sep 2013
Location: mumbai
Posts: 2,219
Thanks: 936
Thanked 8,749 Times in 2,102 Posts
pratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
pratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

15ama

15min AMA where some defaults have been set to 15min TF with my default colors for it

Code:
datamode = ParamToggle("Data Mode", "No|Yes", 0) ;
showintitle = ParamToggle("Show in Title", "No|Yes", 0) ;
showlabel = ParamToggle("Show Label", "No|Yes", 1) ;

usetf = ParamToggle("Use TF", "No|Yes", 1) ;
tf = Param("TF", 15, 1, 100000, 1) ;
isexpandLast = ParamToggle("Expand Mode", "First|Last", 1) ;
expandmode = IIf(isexpandLast, expandLast, expandFirst) ;
period = Param("Period", 30, 1, 100, 1) ;
noiseperiod = Param("Noise Period", 5, 1, 100, 1) ;
Clr = ParamColor("AMA Color", colorRed) ;
ClrClose = ParamColor("AMA Close Color", colorRed) ;

MAwidthper = Param("MA Width %", 0.005, 0, 10, 1) ;
MAwidth = SelectedValue(C) * MAwidthper /100 ;
showasband = ParamToggle("Show as band", "No|Yes", 1) ;
Clrband = ParamColor("Color Band", colorLavender) ;
bandlevel = Param("Level Band", -2, -5, 5, 1) ;
tradearr = ParamToggle("Show Trade Arrow", "No|Yes", 0) ;
triggertypepvt = ParamToggle("Trigger Type", "Bar|Pvt", 0) ;
Onbody= ParamToggle("BO style", "H-L|Body", 1) ;

datamodestyle = styleNoRescale ;
if (NOT showintitle)
	datamodestyle |= styleNoTitle ;
if (NOT showlabel)
	datamodestyle |= styleNoLabel ;

if (datamode)
	datamodestyle = styleNoDraw|styleNoTitle|styleNoLabel|styleNoRescale ;

tfs = tf *in1Minute ;
if (usetf)
	TimeFrameSet(tfs) ;

tfma = int(Interval()/60) ;
if (usetf AND tfs >= Interval())
	tfma = tf ;

strtf = NumToStr(tfma, 8.0)+"min" ;

Refo = ParamField("TF Open", 0) ;
Refh = ParamField("TF High", 1) ;
Refl = ParamField("TF Low", 2) ;
Refc = ParamField("TF Close", 3) ;
//Refbi = ParamField("BI", 4) ;

//Plot(EMA( Close, period ), "", colorRed) ;
fast = 2/(2+1);
slow = 2/(period+1);
dir=abs(Refc -Ref(Refc ,-noiseperiod ));
vol=Sum(abs(Refc -Ref(Refc,-1)),noiseperiod );
ER=dir/vol;
sc =( ER*(fast-slow)+slow)^2; 
amaplotcx = AMA( Refc, sc ); 

dirh=abs(Refh -Ref(Refh ,-noiseperiod ));
volh=Sum(abs(Refh -Ref(Refh,-1)),noiseperiod );
ERh=dirh/volh;
sch =( ERh*(fast-slow)+slow)^2; 
amaplothx = AMA( Refh, sch ); 

dirl=abs(Refl -Ref(Refl ,-noiseperiod ));
voll=Sum(abs(Refl -Ref(Refl,-1)),noiseperiod );
ERl=dirl/voll;
scl =( ERl*(fast-slow)+slow)^2; 
amaplotlx = AMA( Refl, scl ); 

	amaplotc = amaplotcx ;
	amaploth = amaplothx ;
	amaplotl = amaplotlx ;

if (usetf)
{
	amaplotc = TimeFrameExpand(amaplotcx, tfs, expandmode) ;
	amaploth = TimeFrameExpand(amaplothx, tfs, expandmode) ;
	amaplotl = TimeFrameExpand(amaplotlx, tfs, expandmode) ;

	TimeFrameRestore() ;
}

	showoncrb = ParamToggle("Show On CRB", "No|Yes", 0) ;
	Refo = ParamField("CRB Open", 7+0) ;
	Refh = ParamField("CRB High", 7+1) ;
	Refl = ParamField("CRB Low", 7+2) ;
	Refc = ParamField("CRB Close", 7+3) ;
	Refbi = ParamField("CRB BI", 7+4) ;
	Refcrbbars = ParamField("CRB Bars", 7+5) ;
	Refnbars = ParamField("TF Bars", 7+6) ;
	Refdt = ParamField("CRB DT", 7+7) ;


	if (showoncrb)
	{
		diffbars = Refnbars -Refcrbbars -1 ;

		// convert to crb
		Refamaploth = Ref(amaploth, -diffbars) ;
		Refamaplotc = Ref(amaplotc, -diffbars) ;
		Refamaplotl = Ref(amaplotl, -diffbars) ;

//		RefClre = Ref(Clr, -diffbars) ;

		k = 0 ;
		for ( i = Crbst ; i < BarCount ; i++)
		{
			Refbar = Refbi[i];

			Refamaploth[i] = amaploth[Refbar] ;
			Refamaplotc[i] = amaplotc[Refbar] ;
			Refamaplotl[i] = amaplotl[Refbar] ;

//			RefClre[i] = Clr[Refbar];
			k++;
		}
	}
	else
	{
		Refamaploth = amaploth ;
		Refamaplotc = amaplotc ;
		Refamaplotl = amaplotl ;
//		RefClre = Clre ;
	}


Plot(Refamaplotc, strtf+"AMA close"+NumToStr(period, 1.0)+" "+ NumToStr(noiseperiod , 1.0), ClrClose , styleThick|datamodestyle) ;
Plot(Refamaploth, strtf+"AMA high"+NumToStr(period, 1.0)+" "+ NumToStr(noiseperiod , 1.0), Clr, styleThick|datamodestyle) ;
Plot(Refamaplotl, strtf+"AMA low"+NumToStr(period, 1.0)+" "+ NumToStr(noiseperiod , 1.0), Clr, styleThick|datamodestyle) ;
if (MAwidth > 0)
	PlotOHLC(Refamaplotc+MAwidth, Refamaplotc+MAwidth, Refamaplotc-MAwidth, Refamaplotc-MAwidth, "", ClrClose , styleCloud|styleNoLabel|datamodestyle) ;
if (showasband)
{
	PlotOHLC(Refamaploth, Refamaploth, Refamaplotl, Refamaplotl, "", Clrband, styleCloud|styleNoLabel|datamodestyle, 0, 0, 0, bandlevel) ;
}

showparam = ParamToggle("Show Key Param", "No|Yes", 1) ;

if (showparam)
{
	y = (SelectedValue(Refamaploth)+ SelectedValue(Refamaplotl)) /2 ;
	tfsd = tfs ;
	if (tfsd < Interval())
		tfsd = Interval() ;

//	str = "TF="+NumToStr(tfsd/in1Minute, 1.0) + " P=" + NumToStr(period, 1.0)+"-"+ NumToStr(noiseperiod, 1.0);
	str = NumToStr(tfsd/in1Minute, 1.0) + " AMA" ;
	PlotText(str, BarCount+2, y, colorBlack) ;
}

Refo = ParamField("Open", 0) ;
Refh = ParamField("High", 1) ;
Refl = ParamField("Low", 2) ;
Refc = ParamField("Close", 3) ;

if (tradearr) // AND NOT datamode)
{
avgP = (Refh+refl+Refc)/3 ;
p1 = Param("Fast", 1, 1, 100, 1) ;
p2 = Param("Slow", 3, 1, 100, 1) ;

ismph = H-H ;
ismpl = L-L ;

EMA1 = EMA(avgP, p1) ;
EMA2 = EMA(avgP, p2) ;

upcross = Cross(EMA1, EMA2) ;
downcross = Cross(EMA2, EMA1) ;

bi = BarIndex() ; 

mphbar = HighestSinceBars(upcross, Refh) ;
mplbar = LowestSinceBars(downcross, Refl) ;

mphbi = ValueWhen(downcross, bi, 0) - ValueWhen(downcross, mphbar, 0) ;
ismph = mphbi == bi ;

mplbi = ValueWhen(upCross, bi, 0) - ValueWhen(upCross, mplbar, 0) ;
ismpl = mplbi == bi ;

ismph = IIf(downCross AND mphbar == 0, True, ismph) ;
ismpl = IIf(upcross AND mplbar == 0, True, ismpl) ;

showminor = ParamToggle("Show Minor Pvts", "No|Yes", 1) ;
showminorlvls = ParamToggle("Show Minor Levels", "No|Yes", 1) ;

issquare = ParamToggle("Pvt style", "Circle|Square", 0) ;
pvtmarker = IIf(issquare, shapeSmallSquare, shapeSmallCircle) ;

if (showminor)
{
	PlotShapes(ismph*pvtmarker , colorRed, 0, Refh, 12) ;
	PlotShapes(ismpl*pvtmarker , colorGreen, 0, Refl, -12) ;
}

mph = ValueWhen(ismph, Refh) ;
mpl = ValueWhen(ismpl, Refl) ;

if (showminorlvls)
{
	x = LineArray(0, SelectedValue(mph), (BarCount-1), SelectedValue(mph));

	Plot(x, "", colorGold, styleDashed);

	x = LineArray(0, SelectedValue(mpl), (BarCount-1), SelectedValue(mpl));

	Plot(x, "", colorGold, styleDashed);
}


	Reflow = Refl ;
	Refhigh = Refh ;
	if (Onbody)
	{
		Reflow = Min(Refo, Refc) ;
		Refhigh = Max(Refo, Refc) ;
	}
	
	if (triggertypepvt)
	{
		Buy = ismph AND mph > AMAploth ;
		Short = ismpl AND mpl < AMAplotl ;
	}
	else
	{
		Buy = avgP > AMAploth ;
		Short = avgP < AMAplotl ;
	}

	Buy = ExRem(Buy, Short OR Refc < AMAploth ) ;
	Short = ExRem(Short, Buy OR Refc > AMAplotl ) ;

	inbuy = Flip(Buy, Short) ;
	inshort = Flip(Short, Buy) ;

	Sell = (Refc < AMAploth AND NOT Refc  < AMAplotl AND inbuy) ;
	Cover = (Refc  > AMAplotl AND NOT Refc  > AMAploth AND inshort) ;

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

	PlotShapes(Buy*shapeUpTriangle, colorBlue, 0, Refh, 12) ;
	PlotShapes(Short*shapeDownTriangle, colorRed, 0, Refl, 12) ;

	showsl = ParamToggle("Show SL", "No|Yes", 1) ;
	if (showsl)
	{
		PlotShapes(Cover*shapeSmallUpTriangle, colorBlack, 0, Refh, 12) ;
		PlotShapes(Sell*shapeSmallDownTriangle, colorBlack, 0, Refl, 12) ;
	}


}
Reply With Quote
The Following 4 Users Say Thank You to pratapvb For This Useful Post:
eku (7th February 2016), monkeybusiness (8th February 2016), TracerBullet (8th February 2016), zoheb (22nd March 2016)
  #15  
Old 7th February 2016, 08:11 PM
vijkris's Avatar
Member
 
Join Date: Mar 2013
Location: hyderabad
Posts: 3,173
Thanks: 14,020
Thanked 6,666 Times in 2,513 Posts
vijkris has a reputation beyond reputevijkris has a reputation beyond repute
vijkris has a reputation beyond reputevijkris has a reputation beyond reputevijkris has a reputation beyond reputevijkris has a reputation beyond reputevijkris has a reputation beyond reputevijkris has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

pratap sir, no offence , sorry to interrupt the flow,
thanks for starting the thread.

in the image u meant +1sd? or vah

Reply With Quote
The Following 2 Users Say Thank You to vijkris For This Useful Post:
monkeybusiness (8th February 2016), TracerBullet (8th February 2016)
  #16  
Old 7th February 2016, 09:40 PM
Member
 
Join Date: Sep 2013
Location: mumbai
Posts: 2,219
Thanks: 936
Thanked 8,749 Times in 2,102 Posts
pratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
pratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

Quote:
Originally Posted by vijkris View Post
pratap sir, no offence , sorry to interrupt the flow,
thanks for starting the thread.

in the image u meant +1sd? or vah

Yes +1sd not VAH

good to know that people have caught on

Last edited by pratapvb; 7th February 2016 at 10:01 PM.
Reply With Quote
The Following 4 Users Say Thank You to pratapvb For This Useful Post:
eku (7th February 2016), monkeybusiness (8th February 2016), niftytraps (13th February 2016), vijkris (7th February 2016)
  #17  
Old 7th February 2016, 10:13 PM
Member
 
Join Date: Sep 2013
Location: mumbai
Posts: 2,219
Thanks: 936
Thanked 8,749 Times in 2,102 Posts
pratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
pratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

Now based on this combo of information we can take trades

but for that we need some kind of pvts

for coding purpose I created a pvt using 1ema and 3ema cross over. When it cross over to the up a mpl is defined and when it crosses over to the down then an mph is defined. NOTE that this is an approximation of a pvt and not a true pvt created by PA but in 95+% of the cases they will match

with this we can create multiple type of pvts

for e.g. in the charts below the green/brown dots are 5min ema pvts, the green/brown square are more conservative pvts with a factor of 2 ...that is 2ema and 6ema (or could think of it as 10min pvts. The bluegrey/orange pvts are 15min pvts (hence it shows as 3 squares on 5min chart

of course a 15min pvt will also be a 10min pvt and 5min pvt so those are hidden at those pts




Reply With Quote
The Following 6 Users Say Thank You to pratapvb For This Useful Post:
eku (7th February 2016), monkeybusiness (8th February 2016), niftytaurus (8th February 2016), singsanjay09 (5th March 2016), TracerBullet (8th February 2016), vijkris (7th February 2016)
  #18  
Old 7th February 2016, 10:15 PM
Member
 
Join Date: Sep 2013
Location: mumbai
Posts: 2,219
Thanks: 936
Thanked 8,749 Times in 2,102 Posts
pratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
pratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

EMApvts

Code:
// Author: Pratap Balakrishnan
// Copyright: All rights reserved. Not to be circulated or shared or posted on websites without the author's written permission.
// email id: proxypra@gmail.com
//

ro = ParamField("Open", 0) ;
rh = ParamField("High", 1) ;
rl = ParamField("Low", 2) ;
rc = ParamField("Close", 3) ;


P = (rH+rL+rC)/3 ;
p1 = Param("Fast", 1, 1, 100, 1) ;
p2 = Param("Slow", 3, 1, 100, 1) ;
EMAfactor = Param("EMA factor", 1, 1, 100) ;

usebpvts = ParamToggle("Use Body Pvts", "No|Yes", 0) ;
isemapvts = ParamToggle("Pvt Type", "H-L|EMA", 1) ;

ismph = H-H ;
ismpl = L-L ;
bph = Max(rO,rC);
bpl = Min(rO,rC);

if (isemapvts)
{
EMA1 = EMA(P, p1*EMAfactor) ;
EMA2 = EMA(P, p2*EMAfactor) ;

upcross = Cross(EMA1, EMA2) ;
downcross = Cross(EMA2, EMA1) ;

//bph = Max(O,C);
//bpl = Min(O,C);
bi = BarIndex() ;

mphbar = HighestSinceBars(upcross, rH) ;
mplbar = LowestSinceBars(downcross, rL) ;

mphbi = ValueWhen(downcross, bi, 0) - ValueWhen(downcross, mphbar, 0) ;
ismph = mphbi == bi ;

mplbi = ValueWhen(upCross, bi, 0) - ValueWhen(upCross, mplbar, 0) ;
ismpl = mplbi == bi ;

ismph = IIf(downCross AND mphbar == 0, True, ismph) ;
ismpl = IIf(upcross AND mplbar == 0, True, ismpl) ;

bmphbar = HighestSinceBars(upcross, bph) ;
bmplbar = LowestSinceBars(downcross, bpl) ;

bmphbi = ValueWhen(downcross, bi, 0) - ValueWhen(downcross, bmphbar, 0) ;
isbmph = bmphbi == bi ;

bmplbi = ValueWhen(upCross, bi, 0) - ValueWhen(upCross, bmplbar, 0) ;
isbmpl = bmplbi == bi ;

isbmph = IIf(downCross AND bmphbar == 0, True, isbmph) ;
isbmpl = IIf(upcross AND bmplbar == 0, True, isbmpl) ;
}
else
{
	isbmph = ismph = rH >= Ref(rH, -1) AND rH > Ref(rH, 1) ;
	isbmpl = ismpl = rL <= Ref(rL, -1) AND rL < Ref(rL, 1) ;

	ismph = ExRem(ismph, ismpl) ;
	ismpl = ExRem(ismpl, ismph) ;
	isbmph = ExRem(isbmph, isbmpl) ;
	isbmpl = ExRem(isbmpl, isbmph) ;


}

showminor = ParamToggle("Show Minor Pvts", "No|Yes", 1) ;

issquare = ParamToggle("Pvt style", "Circle|Square", 1) ;
Clrmph = ParamColor("MPH Color", colorGreen) ;
Clrmpl = ParamColor("MPL Color", colorBrown) ;

pvtmarker = IIf(issquare, shapeSmallSquare, shapeSmallCircle) ;

if (showminor)
{
if (usebpvts)
{
	PlotShapes(isbmph*pvtmarker , Clrmph , 0, rH, 12) ;
	PlotShapes(isbmpl*pvtmarker , Clrmpl, 0, rL, -12) ;
}
else
{
	PlotShapes(ismph*pvtmarker , Clrmph , 0, rH, 12) ;
	PlotShapes(ismpl*pvtmarker , Clrmpl, 0, rL, -12) ;
}
}

showminorlvls = ParamToggle("Show Minor Levels", "No|Yes", 1) ;

mph = ValueWhen(ismph, rH) ;
mpl = ValueWhen(ismpl, rL) ;

if (showminorlvls)
{
	x = LineArray(0, SelectedValue(mph), (BarCount-1), SelectedValue(mph));

	Plot(x, "", colorGold, styleDashed|styleNoRescale);

	x = LineArray(0, SelectedValue(mpl), (BarCount-1), SelectedValue(mpl));

	Plot(x, "", colorGold, styleDashed|styleNoRescale);
}

showminortrend = ParamToggle("Show Minor Trend", "No|Yes", 0) ;
if (showminortrend)
{
	// initialize minor levels
	mph = ValueWhen(ismph, rH) ;
	mpl = ValueWhen(ismpl, rL) ;
	mbph = ValueWhen(isbmph, bph) ;
	mbpl = ValueWhen(isbmpl, bpl) ;

	// minor trend
	mut = rH > mph OR (rC > mbph) OR (ismph AND rH > Ref(mph, -1));
	mdt = rL < mpl OR (rC < mbpl) OR (ismpl AND rL < Ref(mpl, -1));
	mdt = Flip(mdt, mut) ;
	mut = Flip(mut, mdt) ;
	//mutst = ExRem(mut, mdt) ;
	//mdtst = ExRem(mdt, mut) ;
	
	Clr = IIf(mut, colorBlue, colorRed) ;
//	PlotOHLC(rO,rH,rL,rC, "", Clr, styleCandle|styleNoLabel);
	Plot(4, "", Clr, styleArea|styleOwnScale, 0, 100, 0, -1) ;

}


tffactor = Param("TF Factor", 5, 1, 100, 1)  ;
showhigher = ParamToggle("Show Higher", "No|Yes", 0) ;
ishtfemapvts = ParamToggle("HTF Pvt Type", "H-L|EMA", 1) ;
htfEMAfactor = Param("HTF EMA factor", 1, 1, 100) ;


if (showhigher)
{
tfs = tffactor *Interval() ;

TimeFrameSet(tfs) ;

if (ishtfemapvts)
{
Ptf = (H+L+C)/3 ;
EMA1tf = EMA(Ptf, p1*htfEMAfactor) ;
EMA2tf = EMA(Ptf, p2*htfEMAfactor) ;

upcrosstf = Cross(EMA1tf, EMA2tf) ;
downcrosstf = Cross(EMA2tf, EMA1tf) ;
bphtf = Max(O,C) ;
bpltf = Min(O,C) ;

if (usebpvts)
{
	Refhtf = bphtf ;
	Refltf = bpltf ;
}
else
{
	Refhtf = H ;
	Refltf = L ;
}

mphbartf = HighestSinceBars(upcrosstf, Refhtf) ;
mplbartf = LowestSinceBars(downcrosstf, Refltf) ;

bitf = BarIndex() ;
mphbitf = ValueWhen(downcrosstf, bitf, 0) - ValueWhen(downcrosstf, mphbartf, 0) ;
ismphtf = mphbitf == bitf ;

mplbitf = ValueWhen(upCrosstf, bitf, 0) - ValueWhen(upCrosstf, mplbartf, 0) ;
ismpltf = mplbitf == bitf ;

ismphtf = IIf(downCrosstf AND mphbartf == 0, True, ismphtf) ;
ismpltf = IIf(upcrosstf AND mplbartf == 0, True, ismpltf) ;
}
else
{
	ismphtf = H >= Ref(H, -1) AND H > Ref(H, 1) ;
	ismpltf = L <= Ref(L, -1) AND L < Ref(L, 1) ;

	ismphtf = ExRem(ismphtf, ismpltf) ;
	ismpltf = ExRem(ismpltf, ismphtf) ;
}

if (showminortrend)
{
	// initialize minor levels
	mphtf = ValueWhen(ismphtf, H) ;
	mpltf = ValueWhen(ismpltf, L) ;
	mbphtf = ValueWhen(ismphtf, bphtf) ;
	mbpltf = ValueWhen(ismpltf, bpltf) ;

	// minor trend
	muttf = H > mphtf OR (C > mbphtf) OR (ismphtf AND H > Ref(mphtf, -1));
	mdttf = L < mpltf OR (C < mbpltf) OR (ismpltf AND L < Ref(mpltf, -1));
	mdttf = Flip(mdttf, muttf) ;
	muttf = Flip(muttf, mdttf) ;
	//mutst = ExRem(mut, mdt) ;
	//mdtst = ExRem(mdt, mut) ;
	
	Clrtf = IIf(muttf, colorBlue, colorRed) ;
//	PlotOHLC(rO,rH,rL,rC, "", Clr, styleCandle|styleNoLabel);
	Clrtfe = TimeFrameExpand(Clrtf, tfs, expandLast) ;
	Plot(2, "", Clrtfe, styleArea|styleOwnScale, 0, 100) ;


}

ismphtfe = TimeFrameExpand(ismphtf, tfs, expandFirst) ;
ismpltfe = TimeFrameExpand(ismpltf, tfs, expandFirst) ;

He=TimeFrameExpand(H, tfs, expandFirst) ;
Le=TimeFrameExpand(L, tfs, expandFirst) ;

mphhtf = ValueWhen(ismphtf, H) ;
mplhtf = ValueWhen(ismpltf, L) ;

muthtf = H > mphhtf OR (ismphtf AND H > Ref(mphhtf, -1));
mdthtf = L < mplhtf OR (ismpltf AND L < Ref(mplhtf, -1));
muthtf = IIf(muthtf AND mdthtf, IIf(C<O, 0, 1), muthtf) ;
mdthtf = IIf(muthtf AND mdthtf, IIf(C>O, 0, 1), mdthtf) ;

TimeFrameRestore() ;
muthtfe = TimeFrameExpand(muthtf, tfs, expandFirst) ;
mdthtfe = TimeFrameExpand(mdthtf, tfs, expandFirst) ;

mphhtfe = TimeFrameExpand(mphhtf, tfs, expandLast) ;
mplhtfe = TimeFrameExpand(mplhtf, tfs, expandLast) ;

ishtfmph = IIf(ismph == ismphtfe, 1, 0) ;
ishtfmpl = IIf(ismpl == ismpltfe, 1, 0) ;


PlotShapes(ismphtfe *shapeSmallSquare, Clrmph , 0, He, 12) ;
PlotShapes(ismpltfe *shapeSmallSquare, Clrmpl, 0, Le, -12) ;

showhtflvls = ParamToggle("Show HTF levels", "No|Yes", 1) ;
Clrhtflvl = colorPaleGreen ;

//Plot(2, "", IIf(ismph , colorBlue, IIf(ismpl, colorRed, colorGrey40)), styleArea|styleOwnScale, 0, 100) ;
//Plot(4, "", IIf(ishtfmph , colorBlue, IIf(ishtfmpl , colorRed, colorGrey40)), styleArea|styleOwnScale, 0, 100) ;
	mphhtf = ValueWhen(ismphtfe , He, 1) ;
	mplhtf = ValueWhen(ismpltfe , Le, 1) ;

if (showhtflvls )
{
	mphhtf = ValueWhen(ismphtfe , He, 1) ;
	mplhtf = ValueWhen(ismpltfe , Le, 1) ;
	x = LineArray(0, SelectedValue(mphhtf), (BarCount-1), SelectedValue(mphhtf));

	Plot(x, NumToStr(tfs/in1Minute, 1.0)+"min mph", Clrhtflvl , styleDashed|styleNoRescale|styleNoTitle);

	x = LineArray(0, SelectedValue(mplhtf), (BarCount-1), SelectedValue(mplhtf));

	Plot(x, NumToStr(tfs/in1Minute, 1.0)+"min mpl", Clrhtflvl , styleDashed|styleNoRescale|styleNoTitle);
}

showhtftrend = ParamToggle("Show HTF Trend", "No|Yes", 0) ;
Htfbarht = Param("HTF Trend Bar Ht", 4, 1,100) ;
riblayer = Param("Ribbon Layer", 1, -5, 5) ;

if (showhtftrend)
{
	mdthtfe = Flip(mdthtfe, muthtfe) ;
	muthtfe = Flip(muthtfe, mdthtfe) ;

	Plot(Htfbarht, "", IIf(muthtfe, colorBlue, colorRed), styleArea|styleNoLabel|styleOwnScale, 0, 100, 0, riblayer) ;
}
//Plot(2, "", IIf(ismphtfe , colorRed, IIf(ismpltfe , colorBlue, colorGrey40)), styleArea|styleOwnScale, 0, 100) ;
//Plot(4, "", IIf(ismph, colorRed, IIf(ismpl , colorBlue, colorGrey40)), styleArea|styleOwnScale, 0, 100) ;
}
Reply With Quote
The Following 7 Users Say Thank You to pratapvb For This Useful Post:
eku (7th February 2016), monkeybusiness (8th February 2016), niftytaurus (8th February 2016), singsanjay09 (5th March 2016), TracerBullet (8th February 2016), vijkris (7th February 2016), zoheb (22nd March 2016)
  #19  
Old 7th February 2016, 10:16 PM
Member
 
Join Date: Sep 2013
Location: mumbai
Posts: 2,219
Thanks: 936
Thanked 8,749 Times in 2,102 Posts
pratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
pratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

EMApvtsTF

to puts pvts of higher TF. default is set to 15min

Code:
// Author: Pratap Balakrishnan
// Copyright: All rights reserved. Not to be circulated or shared or posted on websites without the author's written permission.
// email id: proxypra@gmail.com
//

debug = ParamToggle("Debug", "No|Yes", 0) ;

ro = ParamField("Open", 0) ;
rh = ParamField("High", 1) ;
rl = ParamField("Low", 2) ;
rc = ParamField("Close", 3) ;

p1 = Param("Fast", 1, 1, 100, 1) ;
p2 = Param("Slow", 3, 1, 100, 1) ;
usebpvts = ParamToggle("Use Body Pvts", "No|Yes", 0) ;
isemapvts = ParamToggle("Pvt Type", "H-L|EMA", 1) ;

showminor = ParamToggle("Show Minor Pvts", "No|Yes", 1) ;

issquare = ParamToggle("Pvt style", "Circle|Square", 1) ;
Clrmph = ParamColor("MPH Color", colorBlueGrey) ;
Clrmpl = ParamColor("MPL Color", colorOrange) ;

pvtmarker = IIf(issquare, shapeSmallSquare, shapeSmallCircle) ;

showminortrend = ParamToggle("Show Minor Trend", "No|Yes", 1) ;
barht = Param("Bar Ht", 4, 0, 100, 1) ;
showtrendclronbar = ParamToggle("Show Trend on Bar", "No|Yes", 0) ;

tf = Param("TF", 15, 1, 100, 1)  ;
showhigher = ParamToggle("Show Higher", "No|Yes", 1) ;

tfs = tf *in1Minute;

TimeFrameSet(tfs) ;

if (isemapvts)
{
	Ptf = (H+L+C)/3 ;
	EMA1tf = EMA(Ptf, p1) ;
	EMA2tf = EMA(Ptf, p2) ;

	upcrosstf = Cross(EMA1tf, EMA2tf) ;
	downcrosstf = Cross(EMA2tf, EMA1tf) ;
	bphtf = Max(O,C) ;
	bpltf = Min(O,C) ;

	if (usebpvts)
	{
		Refhtf = bphtf ;
		Refltf = bpltf ;
	}
	else
	{
		Refhtf = H ;
		Refltf = L ;
	}

	mphbartf = HighestSinceBars(upcrosstf, Refhtf) ;
	mplbartf = LowestSinceBars(downcrosstf, Refltf) ;

	bitf = BarIndex() ;
	mphbitf = ValueWhen(downcrosstf, bitf, 0) - ValueWhen(downcrosstf, mphbartf, 0) ;
	ismphtf = mphbitf == bitf ;

	mplbitf = ValueWhen(upCrosstf, bitf, 0) - ValueWhen(upCrosstf, mplbartf, 0) ;
	ismpltf = mplbitf == bitf ;

	ismphtf = IIf(downCrosstf AND mphbartf == 0, True, ismphtf) ;
	ismpltf = IIf(upcrosstf AND mplbartf == 0, True, ismpltf) ;
}
else
{
	ismphtf = H > Ref(H, -1) AND H > Ref(H, 1) ;
	ismpltf = L < Ref(L, -1) AND L < Ref(L, 1) ;
}

	// initialize minor levels
	mphtf = ValueWhen(ismphtf, H) ;
	mpltf = ValueWhen(ismpltf, L) ;
	mbphtf = ValueWhen(ismphtf, bphtf) ;
	mbpltf = ValueWhen(ismpltf, bpltf) ;

	// minor trend
	mphbreak = H > mphtf OR (ismphtf AND H > Ref(mphtf, -1));
	mplbreak = L < mpltf OR (ismpltf AND L < Ref(mpltf, -1));
	mdttf = Flip(mplbreak , mphbreak ) ;
	muttf = Flip(mphbreak , mplbreak) ;
	//mutst = ExRem(mut, mdt) ;
	//mdtst = ExRem(mdt, mut) ;
	
	Clrtf = IIf(muttf, colorBlue, colorRed) ;
//	PlotOHLC(rO,rH,rL,rC, "", Clr, styleCandle|styleNoLabel);
	Clrtfe = TimeFrameExpand(Clrtf, tfs, expandFirst) ;
	mphbreake = TimeFrameExpand(mphbreak, tfs, expandFirst) ;
	mplbreake = TimeFrameExpand(mplbreak, tfs, expandFirst) ;

//	Plot(barht, "", Clrtfe, styleArea|styleOwnScale, 0, 100) ;

nlvls = Param("No. of Lvls", 0, 0, 100, 1) ;
showlvls = ParamToggle("Show Lvls", "No|Yes", 0) ;
showatbodies = ParamToggle("Show at Bodies", "No|Yes", 1) ;
showlabel = ParamToggle("Show Label", "No|Yes", 1) ;

Clrhigh = ParamColor("Color High", colorRed) ;
Clrlow = ParamColor("Color Low", colorBlue) ;
styl = 0 ;
if (NOT showlabel)
	style |= styleNoLabel ;

if (showlvls)
{
	for (i = 1 ; i <= nlvls; i++) 
	{
		Lvlh = ValueWhen(ismphtf, IIf(showatbodies, Max(O,C), H), i) ;
		Lvll = ValueWhen(ismpltf, IIf(showatbodies, Min(O,C), L), i) ;

		Lvlhe = TimeFrameExpand(Lvlh, tfs, expandFirst) ;
		Lvlle = TimeFrameExpand(Lvll, tfs, expandFirst) ;

		Plot(IIf(Lvlhe == Ref(Lvlhe, 1), Lvlhe, Null), "", Clrhigh, styleThick|styl |styleNoRescale) ;
		Plot(IIf(Lvlle == Ref(Lvlle, 1), Lvlle, Null), "", Clrlow, styleThick|styl |styleNoRescale) ;
	}
}

ismphtfe = TimeFrameExpand(ismphtf, tfs, expandFirst) ;
ismpltfe = TimeFrameExpand(ismpltf, tfs, expandFirst) ;
mphtfe = TimeFrameExpand(mphtf, tfs, expandLast) ;
mpltfe = TimeFrameExpand(mpltf, tfs, expandLast) ;

He=TimeFrameExpand(H, tfs, expandFirst) ;
Le=TimeFrameExpand(L, tfs, expandFirst) ;

TimeFrameRestore() ;

//ishtfmph = IIf(ismph == ismphtfe, 1, 0) ;
//ishtfmpl = IIf(ismpl == ismpltfe, 1, 0) ;

	showoncrb = ParamToggle("Show On CRB", "No|Yes", 0) ;
	Refo = ParamField("CRB Open", 7+0) ;
	Refh = ParamField("CRB High", 7+1) ;
	Refl = ParamField("CRB Low", 7+2) ;
	Refc = ParamField("CRB Close", 7+3) ;
	Refbi = ParamField("CRB BI", 7+4) ;
	Refcrbbars = ParamField("CRB Bars", 7+5) ;
	Refnbars = ParamField("TF Bars", 7+6) ;
	Refdt = ParamField("CRB DT", 7+7) ;


	if (showoncrb)
	{
		diffbars = Refnbars -Refcrbbars -1 ;

		// convert to crb
		Refismphtfe = Ref(ismphtfe, -diffbars) ;
		Refismpltfe = Ref(ismpltfe, -diffbars) ;
		RefHe = Ref(He, -diffbars) ;
		RefLe = Ref(Le, -diffbars) ;
		RefClrtfe = Ref(Clrtfe, -diffbars) ;

//		RefClre = Ref(Clr, -diffbars) ;

		k = 0 ;
		for ( i = Crbst ; i < BarCount ; i++)
		{
			Refbar = Refbi[i];

			Refismphtfe[i] = ismphtfe[Refbar] ;
			Refismpltfe[i] = ismpltfe[Refbar] ;

			RefHe[i] = He[Refbar] ;
			RefLe[i] = Le[Refbar] ;

			RefClrtfe[i] = Clrtfe[Refbar] ;
//			RefClre[i] = Clr[Refbar];
			k++;
		}
	}
	else
	{
		Refismphtfe = ismphtfe ;
		Refismpltfe = ismpltfe ;
		RefHe = He;
		RefLe = Le;
		RefClrtfe = Clrtfe;

//		RefClre = Clre ;
	}


markpvts = ParamToggle("Mark Pvts", "No|Yes", 1) ;
showtext = ParamToggle("Show Text", "No|Yes", 1) ;
txtoff = 16 ;
ribLayer = Param("Rib Layer", 0, -5, 5, 1) ;


if (markpvts)
{
	PlotShapes(Refismphtfe *pvtmarker , Clrmph , 0, RefHe, 12) ;
	PlotShapes(Refismpltfe *pvtmarker , Clrmpl, 0, RefLe, -12) ;
}

if (showminortrend)
	Plot(barht, "", RefClrtfe, styleArea|styleOwnScale, 0, 100, 0, ribLayer ) ;

if (showtrendclronbar)
{

	// minor trend
	hbreak = H > Ref(mphtfe, -1) ;
	lbreak = L < Ref(mpltfe, -1) ; 
	mdt = Flip(lbreak , hbreak ) ;
	mut = Flip(hbreak , lbreak) ;
	//mutst = ExRem(mut, mdt) ;
	//mdtst = ExRem(mdt, mut) ;
	
	Clr = IIf(mut, colorBlue, colorRed) ;
//	PlotOHLC(rO,rH,rL,rC, "", Clr, styleCandle|styleNoLabel);

	SetBarFillColor(Clr) ;
	Plot(C, "", Clr, styleCandle|styleNoLabel, 0,0,0,1) ;
}

	ismph = Refismphtfe AND (RefHe == H) ;
	ismpl = Refismpltfe AND (RefLe == L) ;

if (showtext)
{
	bi = BarIndex() ;

	st = LowestVisibleValue(bi) ;
	ed = HighestVisibleValue(bi) ;

	for (i = st ; i <=ed ; i++)
	{
		if (ismph[i])
			PlotText(NumToStr(Refhe[i], 8.1), i-2, Refhe[i] +txtoff-2, colorBlack) ;
		if (ismpl[i])
			PlotText(NumToStr(Refle[i], 8.1), i-2, Refle[i] -txtoff, colorBlack) ;
	}
}

showerls = Param("Show ERLs", 0, 0, 10, 1) ;
showderls = Param("Show DERLs", 0, 0, 10, 1) ;

	showmoves = ParamToggle("Show Moves", "No|Yes", 0) ;
	Connectlast = ParamToggle("Connect Last", "No|Yes", 0) ;
	Clrmoveup = ParamColor("Color Move Up", colorBlue) ;
	Clrmovedn = ParamColor("Color Move Down", colorRed) ;


if (showerls > 0)
{
	Clrerlres = Clrmovedn ;
	Clrerlsupp = Clrmoveup ;

mphb = (NOT mphbreake) AND Ref(mphbreake, 1) ;
mplb = (NOT mplbreake) AND Ref(mplbreake, 1) ;
mph = ValueWhen(ismphtfe, H, 1) ;
mpl = ValueWhen(ismpltfe, L, 1) ;
	for (i = 1 ; i <= showerls ; i++)
	{
		res = ValueWhen(mphb, mph, i) ;
		supp = ValueWhen(mplb, mpl, i) ;
		
		Plot(res, "", Clrerlres, styleNoLine|styleDots|styleNoTitle|styleNoRescale) ;		
		Plot(supp, "", Clrerlsupp, styleNoLine|styleDots|styleNoTitle|styleNoRescale) ;
	}
}

if (showderls > 0)
{
	Clrderlres = Clrmovedn ;
	Clrderlsupp = Clrmoveup ;

	bi = BarIndex() ;

	for (i = 1 ; i <= showderls ; i++)
	{
		res1 = ValueWhen(ismph, H, i) ;
		res1bi = ValueWhen(ismph, bi, i) ;

		res2 = ValueWhen(ismph, H, i+1) ;
		res2bi = ValueWhen(ismph, bi, i+1) ;

		supp1 = ValueWhen(ismpl, L, i) ;
		supp1bi = ValueWhen(ismpl, bi, i) ;

		supp2 = ValueWhen(ismpl, L, i+1) ;
		supp2bi = ValueWhen(ismpl, bi, i+1) ;

		derlres = LineArray(SelectedValue(res2bi), SelectedValue(res2), SelectedValue(res1bi), SelectedValue(res1), 1) ;
		derlsupp = LineArray(SelectedValue(supp2bi), SelectedValue(supp2), SelectedValue(supp1bi), SelectedValue(supp1), 1) ;
		
		Plot(derlres, "", Clrderlres, styleLine|styleNoTitle|styleNoRescale) ;		
		Plot(derlsupp, "", Clrderlsupp, styleLine|styleNoTitle|styleNoRescale) ;
	}
}

//Plot(2, "", IIf(ismphtfe , colorRed, IIf(ismpltfe , colorBlue, colorGrey40)), styleArea|styleOwnScale, 0, 100) ;
//Plot(4, "", IIf(ismph, colorRed, IIf(ismpl , colorBlue, colorGrey40)), styleArea|styleOwnScale, 0, 100) ;

if(showmoves)
{
	bi = BarIndex();
	edbi = HighestVisibleValue(bi) ;
	stbi = LowestVisibleValue(bi) ;

	stph = Null ;
	stx = 0 ;
	edx = 0 ;
	edph = Null ;
	for (i = stbi; i <= edbi ; i++)
	{
		if (ismph) // (Refismphtfe[i] AND RefHe[i] == H[i])
		{
			stph = edph ;
			edph = H[i] ;
			stx = edx ;
			edx = i ;
		}

		if (ismpl) // (Refismpltfe[i] AND RefLe[i] == L[i])
		{
			stph = edph ;
			edph = L[i] ;
			stx = edx ;
			edx = i ;
		}

		if (stx!= 0 AND edx !=0)
		{		
		pline = LineArray(stx, stph, edx, edph); 

		Plot(pline, "", IIf(stph < edph, Clrmoveup, Clrmovedn), styleThick|styleNoLabel) ;
		}
	
	}

	if (Connectlast)
	{
			stx = edx ;
			edx = BarCount-1 ;
			stph = edph ;
			edph = C[edx] ;
		if (stx!= 0 AND edx !=0)
		{		
		pline = LineArray(stx, stph, edx, edph); 

		Plot(pline, "", IIf(stph < edph, Clrmoveup, Clrmovedn), styleThick|styleNoLabel) ;
		}
	
	}
}

mut = Refclrtfe == colorBlue ;
mdt = NOT mut ;
showzone = ParamToggle("Show Zone", "No|Yes", 0) ;
showasdefarea = ParamToggle("Show as Def Area", "No|Yes", 1) ;
zoneonbodies = ParamToggle("Zone on bodies", "No|Yes", 1) ;
Layerzone = Param("Layer zone", -4, -5, 5, 1) ;
Clrzone = IIf(mut, ParamColor("Zone UT", colorSkyblue), ParamColor("Zone DT", colorRose)) ;
if (showzone)
{

	mph = ValueWhen(ismph, H) ;
	mpl = ValueWhen(ismpl, L) ;
	mbph = ValueWhen(ismph, Max(C, O));
	mbpl = ValueWhen(ismpl, Min(C, O)) ;

	hbreak = IIf(ismph, H > Ref(mph, -1), H > mph) ;
	lbreak = IIf(ismpl, L < Ref(mpl, -1), L < mpl) ;
	Hbreak = ExRem(Hbreak, ismph) ;
	Lbreak = ExRem(Lbreak, ismpl) ;

	up = Flip(Hbreak, Lbreak) ;

	mphbreak = Refclrtfe != Ref(Refclrtfe, -1) AND Refclrtfe == colorBlue;
	mplbreak = Refclrtfe != Ref(Refclrtfe, -1) AND Refclrtfe == colorRed;

	zmph = IIf(zoneonbodies, mbph, mph) ;
	zmpl = IIf(zoneonbodies, mbpl, mpl) ;
	if (showasdefarea)
	{
		zoneh = IIf(up, ValueWhen(hbreak, zmph), ValueWhen(lbreak, zmph)) ;
		zonel = IIf(up, ValueWhen(hbreak, zmpl), ValueWhen(lbreak, zmpl)) ;

	}
	else
	{
		zoneh = ValueWhen(mphbreake OR mplbreake, zmph) ;
		zonel = ValueWhen(mphbreake OR mplbreake, zmpl) ;
	}

	PlotOHLC(zoneh, zoneh, zonel, zonel, "", Clrzone, styleCloud|styleNoLabel|styleNoRescale,0,0,0,Layerzone) ;
}

showtflvls = ParamToggle("Show Lvls", "No|Yes", 1) ;
Clrtflvl = colorPaleGreen ;

if (showtflvls )
{
	Hd = ValueWhen(ismphtfe , He, 1) ;
	Ld = ValueWhen(ismpltfe , Le, 1) ;
	x = LineArray(0, SelectedValue(Hd), (BarCount-1), SelectedValue(Hd));

	Plot(x, NumToStr(tfs/in1Minute, 1.0)+"min mph", Clrtflvl , styleDashed|styleNoRescale);

	x = LineArray(0, SelectedValue(Ld), (BarCount-1), SelectedValue(Ld));

	Plot(x, NumToStr(tfs/in1Minute, 1.0)+"min mpl", Clrtflvl , styleDashed|styleNoRescale);
}
Reply With Quote
The Following 7 Users Say Thank You to pratapvb For This Useful Post:
eku (7th February 2016), monkeybusiness (8th February 2016), niftytaurus (8th February 2016), novicetraders (8th February 2016), TracerBullet (8th February 2016), vijkris (7th February 2016), zoheb (22nd March 2016)
  #20  
Old 7th February 2016, 10:19 PM
Member
 
Join Date: Sep 2013
Location: mumbai
Posts: 2,219
Thanks: 936
Thanked 8,749 Times in 2,102 Posts
pratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
pratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond reputepratapvb has a reputation beyond repute
Default Re: Price Action perspective using VWAP+SD and TF AMAs

for trading purposes I sometimes use 3min and even 2min pvt for entries

Advertisements

Reply With Quote
The Following 3 Users Say Thank You to pratapvb For This Useful Post:
eku (7th February 2016), monkeybusiness (8th February 2016), vijkris (7th February 2016)
Reply

Bookmarks

Tags
price action trading, vwap


Advertise Here


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads for: Price Action perspective using VWAP+SD and TF AMAs
Thread Thread Starter Forum Replies Last Post
VWAP/ATP Values for creating Price Charts.. tradingstudent AmiBroker 15 12th January 2016 12:07 AM
Volume weighted average price-Vwap rangarajan Day Trading 7 22nd July 2013 06:12 PM
VWAP(volume weighted average price choudri Technical Analysis 1 8th April 2012 07:12 PM
Nifty Price Areas - a different perspective! rajivkhatlawala Technical Analysis 4 7th April 2008 02:09 PM
Price-Volume Relationship- A Different Perspective. Linus Technical Analysis 9 11th June 2007 11:15 AM


All times are GMT +5.5. The time now is 02:10 PM.

Indemnity, Disclaimer & Disclosure Notice:
By visiting Traderji.com you automatically indicate that you agree to our Forum Rules, Indemnity, Disclaimer & Disclosure Notice and General Content Disclaimer Notice and indemnify Traderji.com, its associates and related parties of all claims howsoever resulting from the usage of the forum/site.
Disclaimer: Trading or investing in stocks & commodities is a high risk activity. Any action you choose to take in the markets is totally your own responsibility. You are recommended to make appropriate enquiries and seek appropriate advise before sending money, incurring any expenses, acting on recommendations or entering into any commitment in relation to any advertisement published here. Traderji.com does not vouch for any claims made by the advertisers of products and services. Traderji.com will not be held liable for any consequences in the event such claims are not honoured by the advertisers. Traderji.com will not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of any information by anybody mentioned anywhere on this site.
Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein. The writers may or may not be trading in the securities mentioned.
All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy or legality of any information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. Although we constantly delete all irrelevant content and/or SPAM, if you should find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.
 


Copyright © www.Traderji.com 2001 - , All rights reserved.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70