Combining Trend-VWAP-Ranges - Pratap's method

pratapvb

Well-Known Member
#31
Pratap, Should expiry vwap be used this week?
vwap expiry was made for friday after expiry as when contract changes 2day vwap gets distorted
 

niftytaurus

Well-Known Member
#32
Dear Pratap Bro
I use 15 min bands to decide trend.but if we need to enter on this trend..how do we decide that retracement/ pullback is finshed..
1)example, we are in downtrend, now a pullback rally starts..this rally can be one leg, 2 leg or 3 leg, how do we decide that now pullback raly is finished & now market will go in trend direction?
2) if we are in downtrend according to 15 min bands .. & then it pulbacks/ retraces .. sometimes market go till 3 min band high/low & sometimes it goes till 15 min band high/low...how do we decide exact timing to enter in short trade?
thanks
 

pratapvb

Well-Known Member
#33
Dear Pratap Bro
I use 15 min bands to decide trend.but if we need to enter on this trend..how do we decide that retracement/ pullback is finshed..
1)example, we are in downtrend, now a pullback rally starts..this rally can be one leg, 2 leg or 3 leg, how do we decide that now pullback raly is finished & now market will go in trend direction?
2) if we are in downtrend according to 15 min bands .. & then it pulbacks/ retraces .. sometimes market go till 3 min band high/low & sometimes it goes till 15 min band high/low...how do we decide exact timing to enter in short trade?
thanks

these points need to be considered as s/r and look for action around there to decide whether over....like 2bar trigger or pvt or something as appropriate
 

pratapvb

Well-Known Member
#34
I think this AFL was put in the old thread but it maybe lost when that thread was damaged. So re posting

The logic is described in the comments in the beginning. This can be put on any TF chart below daily TF

This was shared to me by a trading friend (possibily initial version from net) and I have his permission to share it

Put price first and then this AFL or on any of your existing panes



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", 1) ;
showsltrigger = ParamToggle("Show SL Trigger", "No|Yes", 1) ;

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);
 
Last edited:

amitrandive

Well-Known Member
#35
I think this AFL was put in the old thread but it maybe lost when that thread was damaged. So re posting

The logic is described in the comments in the beginning. This can be put on any TF chart below daily TF

This was shared to me by a trading friend (possibily initial version from net) and I have his permission to share it



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", 1) ;
showsltrigger = ParamToggle("Show SL Trigger", "No|Yes", 1) ;

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);
Sir , chart not plotting on 5 minutes .
Any parameter issues ?


 

pratapvb

Well-Known Member
#36

pratapvb

Well-Known Member
#38

pratapvb

Well-Known Member
#39
code below price with high vol highligted with dot

there are various things that can be done depending on how the parameters are selected
1. different scipt in other pane
2. different tf in other pane
3. coloring the bar as per yday close
4. scaling the pane so that there is some free area above and below chart

checkout the parameters

Code:
_SECTION_BEGIN("HighVol");
SetChartOptions(0,chartShowArrows|chartShowDates|chartWrapTitle);
SetChartBkColor(ParamColor("Background", colorLightGrey)) ;

useforeign = ParamToggle("Set Foreign", "No|Yes", 0) ;
//List = GetCategorySymbols(categoryMarket, 0) ;
//forscript = ParamList("Scrip", List, 0) ;
forscript = ParamStr("Foreign Script", "BANKNIFTY-I") ;
if (useforeign)
	SetForeign(forscript); 

settf = ParamToggle("Set TF", "No|Yes", 0) ;
tf = Param("TF", 5, 1, 100000, 1) ;

if (settf)
{
	SetChartOptions(3,chartShowDates);
	TimeFrameSet(tf*in1Minute) ;
}

Layer = Param("Layer", 0, -5, 5, 1) ;
if (settf)
	tz = NumToStr(tf, 8.0) +"-minute";
else
	tz = NumToStr(Interval()/in1Minute, 8.0) +"-minute";

strname =  Name();
if (useforeign)
	strname = forscript ;

//_N(Title = StrFormat(Name() + " " +tz + " " + NumToStr(ddt, formatDateTime) + " Range %g {{VALUES}}", SelectedValue( dh-dl) ));
_N(Title = StrFormat(strname+tz+ NumToStr(DateTime(), formatDateTime)+ EncodeColor( colorGreen ) + " Open %g," + EncodeColor( colorBlue ) + " Hi %g,  " + EncodeColor( colorRed ) + " Lo %g,  " + EncodeColor( colorBlack ) + " Close %g (%.1f%%){{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

showprice = ParamToggle("Show Price", "No|Yes", 1) ;
styleprice = IIf(showprice, 0, styleNoDraw) ;
//if (showprice)
	Plot( C, "Close",  colorBlack, styleNoTitle | styleCandle|styleprice,0,0,0,Layer ); 
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C ;

if (settf)
{
Daych = Day() != Ref(Day(), -1) ;
Plot(IIf(Daych, 100, 0), "", colorBlack, styleHistogram|styleNoLabel|styleOwnScale, 0, 100, 0, -5) ;
}
//Peaking Volumes
HiVolume = IIf(V > (2 * MA(V,10)), True, False); 
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorBlack, colorWhite), 0, (O+C)/2, 0);
//TimeFrameRestore()

Clronclose = ParamToggle("Color on yday close", "No|Yes", 0) ;
if (Clronclose)
{
	ydayc = TimeFrameGetPrice("C", inDaily,0, expandLast) ;

	Clr = IIf(C > ydayc, colorBlue, IIf(C < ydayc, colorRed, colorGrey40)) ;
	SetBarFillColor(Clr) ;
	Plot(C, "", Clr, styleCandle|styleNoLabel, 0, 0, 0, 1) ;
}

scalefromclose = ParamToggle("Scale from Close", "No|Yes", 1) ;
per = Param("Percentage",40,0,50,10);
Mingap = Param("Min Gap", 20, 1, 10000, 1) ;

if (scalefromclose)
{
	Lvh = Lvl = SelectedValue(C);
	Lvhh = HighestVisibleValue(H) ;
	Lvll = LowestVisibleValue(L) ;
	spl = sph = (Lvhh-Lvll)*per/100 ; // Param("pointsup",50,0,500,10);
	Plot( Max(Max(Lvh+sph, Lvhh+sph/2), Lvh+Mingap), "", colorBlack,styleNoDraw);
	Plot( Min(Min(Lvl-spl, Lvll-spl/2), Lvl-Mingap), "", colorBlack,styleNoDraw);
}


_SECTION_END();
e.g.

NF 3min and 5min

vertical lines in lower pane are day changes
as TF is different hozintal scale not there

one can select the bar and see time and details in title or on mouse move tip



nf 3min 15min



NF 3min 1st pane

bnf 5min 2nd pane :D

 

monkeybusiness

Well-Known Member
#40
code below price with high vol highligted with dot

there are various things that can be done depending on how the parameters are selected
1. different scipt in other pane
2. different tf in other pane
3. coloring the bar as per yday close
4. scaling the pane so that there is some free area above and below chart

checkout the parameters
Thanks Sir,

:clapping::clapping::clapping::clapping:
 

Similar threads