Price Action perspective using VWAP+SD and TF AMAs

pratapvb

Well-Known Member
#21
then finally for some additional s/rs for aggressive profit taking (maybe on 2min ama band or such)

for this I have
1. noise around the open ...the noise range is derived dyamically based on last few days for daily PA

top pane in the chart below

2. Demark Floor pvts which I have further tweeked to create a sort of band around the pvt where trend is minimal

bottom pane in the chart below

 

pratapvb

Well-Known Member
#22
Noise AFL

Code:
SetChartOptions(2,chartWrapTitle);

/*Definitions -

Noise -The difference between the Open AND the closest extreme point of that Day.

Expansion -The difference between the Open AND the farthest extreme point of that Day.

Daily Range -The difference between High AND Low of a trading Day.

Example

Yesterday, for ES 12-14 we had the following data points:

Full session: Open = 2002.00, High = 2003.00, Low = 1982.50, Settlement = 1986.25

Regular session: Open = 1998.75, High = 1999.25, Low = 1982.50, Settlement = 1986.25

Noise AND expansion can be calculated for the full session OR for the regular session. I mostly use the concept for the regular session.
Full session: noise = 2003.00 - 2002.00 = 1.00 points, expansion = 2002.00 - 1982.50 = 19.50 points, daily range = 2003.00 - 1982.50 = 20.50 points
Regular session: noise = 1999.25 - 1998.75 = 0.50 points, expansion = 1998.75 - 1982.50 = 16.25 points, daily range = 1999.25 - 1982.50 = 16.75 points

Formulas -

Noise = Math.Min (High - Open, Open - Low)

Expansion = Math.Max (High - Open, Open - Low)

Daily Range = High - Low

Average daily noise(AND), Average daily expansion(ADE), Average daily range (ADR) -
Calculating the 10-Day AND 20-Day average for daily noise, daily expansion AND daily range, 
then calculating the arithmetic mean of 10-Day AND 20-Day average. 10 AND 20 are selectable input parameters, 
for example you can also calculate noise bands based on 5-Day AND 10-Day averages.

Logic -

Noise bands are based on the (average) volatility that comes into the market as a result of the participation of noise traders. 
They can be used in a similar way as the opening range. 
Noise bands are based on the volatility of the prior N days, while the opening range is based on the volatility for the current session. 
The noise bands can be drawn with the first tick of the regular session, 
while the opening range can only be drawn once the opening period is complete. 
I personally prefer noise bands over the opening range as vaild breakout points.  
If I have to strip everything down AND only use one thing. This would be it. 
ADN gives you a clue if you are in a trend OR a range, if you are in a trend the ADR's give you Ultimate targets. 
Any move Inside the ADN should be considered range play. Buy lows AND fade highs, if a FBO of an ADN happens the obvious target is the opposite ADN box.

1) The average daily noise(AND)  is a measure for background volatility created by noise traders. 
This is the amount that price usually moves in the wrong direction, before it develops the trend of the Day.
You may consider the ADN boxes at breakout levels. 
Often price is rejected at this level. A breakout that occurs within the noise bands is usually void.

2) The ADR (average daily range) can be used to establish targets for Open position. 
The relative postion of the ADR versus ADN has no significance. if one of the ADR bands moves within the box, it just shows that price has gone far away from the Open. 
In this case it is NOT the ADR band Close to the noise bands that should be observed, but the other one, which is the target band for the daily range.

3) How can bulls AND bears push the price away from the Open?

bull force = Math.Abs (High - Open) = High - Open

bear force = Math.Abs (Low - Open) = Open - Low

The larger of bull force AND bear force is called expansion (successful move).The smaller of bull force AND bear force is called noise (unsuccessful move).
Take the noise of the last 10 days (all the smaller moves from the Open) AND calculate an average.This is called the average daily noise (ADN).
The ADN tells you how far the losing party (noise traders) will typically push prices against the trend. Any move within the ADN can be considered as NOT significant. 
When price trades beyond the ADN, this may qualify for a real breakout. Price trading within the noise bands means that the market has NOT yet found a trend.

How to use ADN, ADR AND ADE in Trading -

Range:Average Daily Noise (ADN)  provide range tops AND bottoms. 
Any price action that occurs Inside should be considered suspect AND possibly range activity. Look to Buy bounces off the ADN Low AND Sell pivots off the ADN High. 
As long as price is trading Inside of these boxes I am thinking range. 
Buy Low, Sell High AND scalp. if price test one box AND fails, there is High probability that it will then move to test the other box. 
So a failed BO of the ADN Low, I would be looking to Buy with a target of the ADN High.

Bear trend: We are NOT official in a bear trend until we have significant AND accepted price action Outside of the ADN Low. 
At that point I am looking to Sell pullbacks with my target being the ADR Low. Most of the time the bear trend starts from a failure of the ADN High. 
So if you can catch it early you can take the bear leg of the TR down to the ADN Low AND then allow it to work its way out of the box. 
Sometimes you miss that move, so look for pullbacks to enter.

Bull trend: Just as with the bear the bull trend officially starts Outside of the ADN High AND also tends to start with a failure at the ADN Low. 
You look to take the bull leg in the TR targeting the ADN High, if you miss it look for pullbacks Outside the ADN High to Buy.
In strong moves you can even take pullbacks to the ADRs.
*/

TimeFrameSet(inDaily);
ATRdaily = ATR(14) ;
TimeFrameRestore() ;
ATRdaily = TimeFrameExpand(ATRdaily,inDaily);

TimeFrameSet(inDaily);
noise = Min(H-O,O-L);
expansion = Max(H-O,O-L);
range = H-L;

Avg1 = Param("Avg Period 1", 10, 1, 1000) ;
Avg2 = Param("Avg Period 1", 20, 1, 1000) ;
Clrnb = Clrnoise = ParamColor("Color Noise", colorLightBlue) ;

Layer = Param("Layer", -1, -5, 5) ;
showfill = ParamToggle("Show Fill", "No|Yes", 1) ;
showext = ParamToggle("Show Extension", "No|Yes", 1) ;
extend = Param("Extend By", 5, 0, 200, 1) ;
xst = BarCount - (extend) +1 ;
xed = BarCount -1 ;

showtext = ParamToggle("Show Text", "No|Yes", 1) ;
txtpos = BarCount + extend-5 ;
fil = Param("Text Filter", 1, 1, 10000, 1) ;

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


xnoise = MA(noise,Avg1);
xexpansion = MA(expansion,Avg1);
xdrange = MA(range, Avg1);

ynoise = MA(noise,Avg2);
yexpansion = MA(expansion,Avg2);
ydrange = MA(range,Avg2);

anoise = (xnoise + ynoise) / 2;
aexpansion = (xexpansion + yexpansion) / 2;
adrange = (xdrange + ydrange) / 2;
TimeFrameRestore();

anoise = TimeFrameExpand(anoise,inDaily);
aexpansion = TimeFrameExpand(aexpansion,inDaily);
adrange = TimeFrameExpand(adrange,inDaily);
ro = O ;
rh = H ;
rl = L ;
rc = C ;
dt = DateTime() ;
if (showoncrb)
{
	ro = Refo ;
	rh = Refh ;
	rl = Refl ;
	rc = Refc ;	
	dt = Refdt ;
}

a=Day()!=Ref(Day(),-1);
Lod = LowestSince(a,L);
Hod = HighestSince(a,H);

dopen = TimeFrameGetPrice("O",inDaily);
Refadnh = adnh = dopen+anoise ;
Refadnl = adnl = dopen-anoise ;
Refadeh = adeh = dopen+aexpansion ;
Refadel = adel = dopen-aexpansion ;
Refadrh = adrh = Lod+adrange ;
Refadrl = adrl = Hod-adrange ;

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

		// convert to crb
		Refadnh = Ref(adnh, -diffbars) ;
		Refadnl = Ref(adnl, -diffbars) ;
		Refadeh = Ref(adeh, -diffbars) ;
		Refadel = Ref(adel, -diffbars) ;
		Refadrh = Ref(adrh, -diffbars) ;
		Refadrl = Ref(adrl, -diffbars) ;

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

			Refadnh[i] = adnh[Refbar] ;
			Refadnl[i] = adnl[Refbar] ;
			Refadeh[i] = adeh[Refbar] ;
			Refadel[i] = adel[Refbar] ;
			Refadrh[i] = adrh[Refbar] ;
			Refadrl[i] = adrl[Refbar] ;

			k++;
		}
	}

Plot(Refadnh,"ADN-High",colorBlack, styleNoRescale);
Plot(Refadnl,"ADN-Low",colorBlack, styleNoRescale);
doblend = True ;
Clrblend = colorWhite ;
if (doblend)
{
	Clrnb = ColorBlend(Clrnoise, Clrblend) ;
}

if (showfill)
	PlotOHLC(Refadnh, Refadnh, Refadnl, Refadnl, "", Clrnb,styleCloud |styleNoRescale,0,0,0, Layer) ;

showtrigger = ParamToggle("Show Trigger", "No|Yes", 0) ;
showsltrigger = ParamToggle("Show SL Trigger", "No|Yes", 0) ;

Buy = Cross(rC,Refadnh);
Short = Cross(Refadnl,rC);

Cover = Cross(rC,Refadnl);
Sell = Cross(Refadnh,rC);

//AlertIf(Buy,"","Buy"+Name());
//AlertIf(Sell,"","Sell"+Name());
if(showext)
{
Hdlast = SelectedValue(Refadnh) ;
Ldlast = SelectedValue(Refadnl) ;

Hplot = LineArray(xst, Hdlast, xed, Hdlast) ;
Plot(Hplot, "", Clrnoise, styleLine|styleDots|styleNoLabel|styleNoRescale , 0,0,extend) ;
if (showtext)
	PlotText(NumToStr(HdLast, 8.1), txtpos, HdLast+fil, colorBlack) ;

LPlot = LineArray(xst, Ldlast, xed, Ldlast) ;
Plot(LPlot, "", Clrnoise, styleLine|styleDots|styleNoLabel|styleNoRescale , 0,0,extend) ;
if (showtext)
	PlotText(NumToStr(LdLast, 8.1), txtpos, LdLast+fil, colorBlack) ;

PlotOHLC(HPlot, HPlot, LPlot, LPlot, "", Clrnb, styleCloud|styleNoLabel|styleNoTitle|styleNoRescale, 0,0,extend,Layer ) ;
}

if (showsltrigger)
{
PlotShapes(shapeUpArrow*Cover,colorBlack,0,rL);
PlotShapes(shapeDownArrow*Sell,colorBlack,0,rH);
}

if (showtrigger)
{
PlotShapes(shapeUpArrow*Buy,colorBlue,0,rL);
PlotShapes(shapeDownArrow*Short,colorRed,0,rH);
}

//if(Buy[BarCount-1]) Say ("Buy"+Name()+" ");
//if(Sell[BarCount-1]) Say ("sell"+Name()+" ");

//if(Buy[BarCount-1]) Say ("BUY") ;
//if (Sell[BarCount-1]) Say("SELL") ;

Plot(Refadeh,"Expansion-High",colorBrown, styleNoRescale);
Plot(Refadel,"Expansion-Low",colorBrown, styleNoRescale);

Plot(Refadrh,"ADR-High",colorBlue, styleNoRescale);
Plot(Refadrl,"ADR-Low",colorBlue, styleNoRescale);
 

pratapvb

Well-Known Member
#23
Demark Floor pvts with tweek of no trend band


Code:
tf = Param("Ref TF", 1440, 1, 100000, 1) ;
datamode = ParamToggle("Data Mode", "No|Yes", 0) ;
showintitle = ParamToggle("Show in Title", "No|Yes", 0) ;
showlabel = ParamToggle("Show Label", "No|Yes", 1) ;
displaynexttext = ParamToggle("Display Next Text", "No|Yes", 0) ;

Clrhigh = ParamColor("Color High", colorBrown) ;
Clrlow = ParamColor("Color Low", colorGreen) ;
Clrpvt = ParamColor("Color Pivot", colorViolet) ;

showproj = ParamToggle("Show Projection", "No|Yes", 1) ;
showpvt = ParamToggle("Show Pvt", "No|Yes", 1) ;
showsec = ParamToggle("Show Secondary", "No|Yes", 1) ;
shownext = ParamToggle("Show Next", "No|Yes", 0) ;
showbias = ParamToggle("Show Pvt Bias", "No|Yes", 0) ;
shownextpvtbias = ParamToggle("Show Next Pvt Lvls", "No|Yes", 0) ;
showext = ParamToggle("Show Extension", "No|Yes", 1) ;
extend = Param("Extend By", 10, 0, 200, 1) ;
showtradearr = ParamToggle("Show Trade Arrow", "No|Yes", 0) ;
useFilter = ParamToggle("Use Filter", "No|Yes", 1) ;
filhigh = ParamField("Filter High", 0) ;
fillow = ParamField("Filter Low", 0) ;
showbiaszone = ParamToggle("Show bias zone", "No|Yes", 1) ;
biaszonelayer = Param("Bias Zone Layer", -3, -5, 5, 1) ;

xst = BarCount - (extend) +1 ;
xed = BarCount -1 ;

showtext = ParamToggle("Show Text", "No|Yes", 1) ;
txtpos = BarCount + extend-5 ;
fil = Param("Text Filter", 1, 1, 10000, 1) ;

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

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



tfs = tf * in1Minute ;
strtf = NumToStr(tf, 1.0) ;

TimeFrameSet(tfs) ;

Refp = IIf(C > O, H, IIf(C < O, L, C)) ;

x = (H+L+C+Refp) / 2 ;
range = H-L ;
tfh = H ;
tfo = O ;
tfc = C ;
tfl = L ;

projhigh = Ref(x, -1) - Ref(L, -1) ;
projlow =  Ref(x, -1) - Ref(H, -1) ;

bc = (Ref(H, -1) + Ref(L, -1))/2 ;
tc = Ref(x,-1) - bc ;
nexth = x - L ;
nextl = x - H ;
nexth2 = x/2 + range ;
nextl2 = x/2 - range ;
nextbc = (H + L)/2 ;
nexttc = x - nextbc ;


Lastbar = BarIndex() == BarCount-1; 

H2 = Ref(x,-1)/2+Ref(range, -1) ;
L2 = Ref(x, -1)/2-Ref(range, -1) ;
x0 = Ref(x,-1)/2 ;

TimeFrameRestore() ;

tfhe = TimeFrameExpand(tfh, tfs, expandFirst) ;
tfoe = TimeFrameExpand(tfo, tfs, expandFirst) ;
tfce = TimeFrameExpand(tfc, tfs, expandFirst) ;
tfle = TimeFrameExpand(tfl, tfs, expandFirst) ;

phe = TimeFrameExpand(projhigh, tfs, expandFirst) ;
ple = TimeFrameExpand(projlow, tfs, expandFirst) ;

bce = TimeFrameExpand(bc, tfs, expandFirst) ;
tce = TimeFrameExpand(tc, tfs, expandFirst) ;


H2e = TimeFrameExpand(H2, tfs, expandFirst) ;
L2e = TimeFrameExpand(L2, tfs, expandFirst) ;
x0e = TimeFrameExpand(x0, tfs, expandFirst) ;

Nullat = x0e != Ref(x0e, 1) ; 
nexthe = TimeFrameExpand(nexth , tfs, expandFirst) ;
nextle = TimeFrameExpand(nextl , tfs, expandFirst) ;
nexth2e = TimeFrameExpand(nexth2 , tfs, expandFirst) ;
nextl2e = TimeFrameExpand(nextl2 , tfs, expandFirst) ;
nextbce = TimeFrameExpand(nextbc , tfs, expandFirst) ;
nexttce = TimeFrameExpand(nexttc , tfs, expandFirst) ;
nextpe = TimeFrameExpand(x/2, tfs, expandFirst) ;
if(shownextpvtbias)
{
	Refnextp = IIf(C > tfoe, tfhe, IIf(C < tfoe, tfle, C)) ;

	nextx = (tfhe+tfle+C+Refnextp) / 2 ;

	Plot(nextx/2, "next pvt", colorViolet, styleDots|styleNoRescale) ;
}

Lastbare = TimeFrameExpand(Lastbar , tfs, expandFirst) ;

if (showproj)
{
Plot(IIf(nullat, Null, tce), strtf+" Proj TC", Clrhigh, styleDashed|datamodestyle ) ;
Plot(IIf(nullat, Null, bce), strtf+" Proj BC", Clrlow, styleDashed|datamodestyle) ;

Plot(IIf(nullat, Null, phe), strtf+" Proj High 1", Clrhigh, styleThick|styleDots|datamodestyle ) ;
Plot(IIf(nullat, Null, ple), strtf+" Proj Low 1", Clrlow, styleThick|styleDots|datamodestyle) ;
}

if(showext)
{
Hdlast = SelectedValue(phe) ;
Ldlast = SelectedValue(ple) ;
pvtdlast = SelectedValue(x0e) ;
nextpeLast = SelectedValue(nextpe) ;

Hplot = LineArray(xst, Hdlast, xed, Hdlast) ;
Plot(Hplot, "", Clrhigh, styleLine|styleDots|datamodestyle|styleNoLabel , 0,0,extend) ;
if (showtext)
	PlotText(NumToStr(HdLast, 8.1), txtpos, HdLast+fil, Clrhigh) ;

LPlot = LineArray(xst, Ldlast, xed, Ldlast) ;
Plot(LPlot, "", Clrlow, styleLine|styleDots|datamodestyle|styleNoLabel , 0,0,extend) ;
if (showtext)
	PlotText(NumToStr(LdLast, 8.1), txtpos, LdLast+fil, Clrlow) ;

CPlot = LineArray(xst, pvtdlast , xed, pvtdlast ) ;
Plot(CPlot, "", Clrpvt, styleLine|styleDots|datamodestyle|styleNoLabel , 0,0,extend) ;
if (showtext)
	PlotText(NumToStr(pvtdLast, 8.1), txtpos, pvtdLast+fil, Clrpvt) ;

nextpPlot = LineArray(xst, nextpeLast , xed, nextpeLast ) ;
Plot(nextpPlot , "", Clrpvt, styleLine|styleDashed|datamodestyle|styleNoLabel , 0,0,extend) ;
if (showtext)
	PlotText(NumToStr(nextpeLast , 8.1), txtpos, nextpeLast +fil, Clrpvt) ;

}
if (showsec)
{
Plot(IIf(nullat, Null, H2e), strtf+" Proj High 2", Clrhigh, styleThick|datamodestyle ) ;
if (showtext)
	PlotText(NumToStr(SelectedValue(H2e), 8.1), txtpos, SelectedValue(H2e)+fil, Clrhigh) ;

Plot(IIf(nullat, Null, L2e), strtf+" Proj Low 2", Clrlow, styleThick|datamodestyle ) ;
if (showtext)
	PlotText(NumToStr(SelectedValue(L2e), 8.1), txtpos, SelectedValue(L2e)+fil, Clrlow) ;



}

Clrbc = colorPink ;
Clrtc = colorLightBlue ;
doblend = True ;
Clrblend = colorWhite ;
if (doblend)
{
	Clrbc = ColorBlend(Clrbc, Clrblend) ;
	Clrtc = ColorBlend(Clrtc, Clrblend) ;
}
if (showpvt)
	Plot(IIf(nullat, Null, x0e), strtf+" Pvt", Clrpvt, styleThick|styleDots|datamodestyle ) ;

showextzone = ParamToggle("Show Zone Extension", "No|Yes", 1)  ;
extendzone = Param("Extend Zone", 15, 0, 100, 1) ;
extlayer = Param("Extend Layer", -1, -5, 5, 1) ;

	Clr =IIf(bce < x0e, Clrbc, Clrtc) ;
	if (showbiaszone)

	PlotOHLC(tce, tce, bce, bce, "", Clr, styleCloud|datamodestyle,0,0,0,biaszonelayer ) ;

	if (showextzone)
	{
			x0 = BarCount - (extendzone+1)+1 ;
			x1 = BarCount -1 ;

			Hdlast = SelectedValue(tce) ;
			Ldlast = SelectedValue(bce) ;

			Hplot = LineArray(x0, Hdlast, x1, Hdlast) ;
//			Plot(Hplot, "VAHext"+strnday, colorOrange, styleLine|styleNoLabel|styleNoTitle|styleNoRescale|styledata|styleshow, 0,0,extend, extlayer) ;
			LPlot = LineArray(x0, Ldlast, x1, Ldlast) ;
//			Plot(LPlot, "VALext"+strnday, colorGreen, styleLine|styleNoLabel|styleNoTitle|styleNoRescale|styledata|styleshow, 0,0,extend, extlayer) ;

			PlotOHLC(HPlot, HPlot, LPlot, LPlot, "", SelectedValue(Clr) , styleCloud|styleNoLabel|styleNoTitle|styleNoRescale, 0,0,extendzone ,extlayer ) ;
	}


if (showbias)
{
	Clr = IIf(C > x0e, colorBlue, colorRed) ;
	Plot(2, "", Clr, styleArea|datamodestyle |styleOwnScale, 0, 100) ;
}
if (shownext)
{
Plot(IIf (Lastbare , nexthe, Null) , "", Clrhigh, styleThick|styleDashed|datamodestyle ) ;
Plot(IIf (Lastbare , nextle, Null), "", Clrlow, styleThick|styleDashed|datamodestyle ) ;
Plot(IIf (Lastbare , nextpe, Null), "", Clrpvt, styleThick|styleDashed|datamodestyle ) ;
}

if (displaynexttext)
{
	fontsz = Param("Font Size", 12, 1, 100, 1) ;
	GfxSelectFont( "Tahoma", fontsz , 100 );
	GfxSetBkMode( 1 );
	pxHeight = Status( "pxchartheight" ) ;
	pxWidth = Status( "pxchartwidth");
	dt_flag = 16 /*wordbreak*/;
	textht = Param("Text Ht", 75, 1, 300,1) ;
	textwidth = Param("Text Width", 200, 1, 300,1) ;
	textgap = 40 ;
	
	x = pxWidth - Param("from right edge", 200	, 0, 1000, 1) ;
	y = Param("From Top", 100, 0, 1000, 1) ;

	Clr = colorBrown ; 
	GfxSetTextColor( Clr );
	GfxDrawText("Demark H2: "+NumToStr(SelectedValue(nexth2e), 1.1),  x,y, x+textwidth , y+textht , dt_flag) ;

	y+=fontsz+2 ;
	GfxDrawText("Demark H1: "+NumToStr(SelectedValue(nexthe), 1.1),  x,y, x+textwidth , y+textht , dt_flag) ;

	y+=fontsz+2 ;
	GfxDrawText("Zone High: "+NumToStr(Max(SelectedValue(nextbce), SelectedValue(nexttce)), 1.1),  x,y, x+textwidth , y+textht , dt_flag) ;

	y+=fontsz+2 ;
	GfxDrawText("Demark Pvt: "+NumToStr(SelectedValue(nextpe), 1.1),  x,y, x+textwidth , y+textht , dt_flag) ;

	y+=fontsz+2 ;
	GfxDrawText("Zone Low: "+NumToStr(Min(SelectedValue(nextbce), SelectedValue(nexttce)), 1.1),  x,y, x+textwidth , y+textht , dt_flag) ;

	y+=fontsz+2 ;
	GfxDrawText("Demark L1: "+NumToStr(SelectedValue(nextle), 1.1),  x,y, x+textwidth , y+textht , dt_flag) ;

	y+=fontsz+2 ;
	GfxDrawText("Demark L2: "+NumToStr(SelectedValue(nextl2e), 1.1),  x,y, x+textwidth , y+textht , dt_flag) ;

	y+=fontsz+2 ;
	y+=fontsz+2 ;
	GfxDrawText("Demark TC: "+NumToStr(SelectedValue(nexttce), 1.1),  x,y, x+textwidth , y+textht , dt_flag) ;

}

if (showtradearr)
{
	biaslevel = x0e ;

	Buy = C > biaslevel AND IIf(usefilter, C>filhigh, True) ;
	Short = C < biaslevel AND IIf(usefilter, C< fillow, True) ;

	Sell = IIf(usefilter, C < fillow AND C > biaslevel, False) ;
	Cover = IIf(usefilter, C > filhigh AND C < biaslevel, False) ;

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

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

	PlotShapes(Buy*shapeUpArrow, colorBlue, 0, H, 12) ;	
	PlotShapes(Short*shapeDownArrow, colorRed, 0, L, 12) ;

	PlotShapes(Cover*shapeUpArrow, colorBlack, 0, H, 12) ;
	PlotShapes(Sell*shapeDownArrow, colorBlack, 0, L, 12) ;
}

	showsr = ParamToggle("Show s/r", "No|Yes", 1) ;
	showzone = ParamToggle("Show Zone", "No|Yes", 1) ;

	if (showsr)
	{

		Hx = IIf(bce > x0e, bce, tce) ;
		Lx = IIf(bce < x0e, bce, tce) ;

		tr = IIf(H2e < C, Null, H2e) ;
		tr = IIf(phe > C, phe, tr) ;
		tr = IIf(Hx > C, Hx, tr) ;
		tr = IIf(x0e > C, x0e, tr) ;
		tr = IIf(Lx > C, Lx, tr) ;
		tr = IIf(ple > C, ple, tr) ;
		tr = IIf(L2e > C, L2e, tr) ;

		ts = IIf(L2e > C, Null, L2e) ;
		ts = IIf(ple < C, ple, ts) ;
		ts = IIf(Lx < C, Lx, ts) ;
		ts = IIf(x0e < C, x0e, ts) ;
		ts = IIf(Hx < C, Hx, ts) ;
		ts = IIf(phe < C, phe, ts) ;
		ts = IIf(H2e < C, H2e, ts) ;

	totfontsz = Param("Tot Bias Font Size", 16, 1, 100, 1) ;
	GfxSelectFont( "Tahoma", totfontsz , 100 );
	GfxSetBkMode( 1 );
	GfxSetTextColor( ParamColor("Tot Text Color", colorBlack) );
	pxHeight = Status( "pxchartheight" ) ;
	pxWidth = Status( "pxchartwidth");
	dt_flag = 16 /*wordbreak*/;
	tottextht = Param("Tot Text Ht", 25, 1, 300,1) ;
	tottextwidth = Param("Tot Text Width", 200, 1, 300,1) ;
	tottextgap = 40 ;
	
	totx = pxWidth - Param("Tot Bias from right edge", 250	, 0, 1000, 1) ;
 	toty = Param("Tot Bias From Top", 70, 0, 1000, 1) ;

	trs = SelectedValue(tr) ;

	inzone = C >= Lx AND C <= Hx ;
	zonetxt = "" ;
	if (SelectedValue(inzone))
		zonetxt = "In ZONE" ;

	if (trs) // != Null)
	{
		GfxDrawText("TR: " + NumToStr(tr, 1.1),  totx,toty, totx+tottextwidth , toty+tottextht , dt_flag) ;
	}

	tss = SelectedValue(ts) ;
	if (tss)// != Null)
	{
		toty += tottextht ;
		GfxDrawText("TS: " + NumToStr(ts, 1.1),  totx,toty, totx+tottextwidth , toty+tottextht , dt_flag) ;
	}

	if (showzone)
	{
		toty += tottextht ;
		GfxDrawText(zonetxt,  totx,toty, totx+tottextwidth , toty+tottextht , dt_flag) ;
	}

	}
 

pratapvb

Well-Known Member
#24
the above is the combination of info that I use to trade

when they are plotted individually there is no clutter but me being too lazy to switch around now I put many of them into the same pane and hence chart looks cluttered. But I have chosen the color combinations is a particular way so that when they are together also I can read the info of the chart

But if you plane to use you could keep a few information separate on other sheets and look at them periodically for levels and combine few as you feel comfortable

The AFLs are designed to mix and match so that different pieces can be added to a pane to create a desired comfortable view

Am done with the basic theory stuff. Now we can discuss and over the next few days I would try to put in a few days charts with analysis as an when possible
 

TracerBullet

Well-Known Member
#25
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




sir this is brilliant approx to pivots which makes logical sense, looks so simple and obvious in hindsight ... with such leaps you might even be able to get approx VP method in afl ( I dont want it ... but just saying )

Maybe this is common in afl land, i only see it for first time ...
 

pratapvb

Well-Known Member
#26
sir this is brilliant approx to pivots which makes logical sense, looks so simple and obvious in hindsight ... with such leaps you might even be able to get approx VP method in afl ( I dont want it ... but just saying )

Maybe this is common in afl land, i only see it for first time ...
I have VP method in AFL ... that is the only thing I have not shared
 

pratapvb

Well-Known Member
#28
sir this is brilliant approx to pivots which makes logical sense, looks so simple and obvious in hindsight ... with such leaps you might even be able to get approx VP method in afl ( I dont want it ... but just saying )

Maybe this is common in afl land, i only see it for first time ...
also not sure if this is common....I had not come across anywhere. I created this when I got frustrated coding for pvts from bars.

P.S. I later did do it
 

niftytaurus

Well-Known Member
#29
Hi Pratap Bro
I have been testing various components of your various afl.I need some more testing on rules which can give consistent result per month..as from my rules, I have make some 95 points after all costs last week ..but today in morning 3 trades lost 45 points..According to rules, I dont take trades after 3 losses, so couldnt take last short trade..so I need to make my system more adaptable.
Could you please tell when you use it..how many average trades come per day in 5 min chart? no of trades per month?how many points can we expect in nifty per month consistently?
thanks
 

vijkris

Learner and Follower
#30
Hi Pratap Bro
I have been testing various components of your various afl.I need some more testing on rules which can give consistent result per month..as from my rules, I have make some 95 points after all costs last week ..but today in morning 3 trades lost 45 points..According to rules, I dont take trades after 3 losses, so couldnt take last short trade..so I need to make my system more adaptable.
Could you please tell when you use it..how many average trades come per day in 5 min chart? no of trades per month?how many points can we expect in nifty per month consistently?
thanks
hi, if u dnt mind, can u pls post charts of those trades.
if u r not comfortable, then pls ignore my post.
thanks
 

Similar threads