30M tracking of Supertrend in Nifty and Bank Nifty

rkkarnani

Well-Known Member
#71
RKK Sir,

You may be right as per your data.... I am using Sharekhan. I believe that the time of the bar start differs as per your and my system. But that should not matter... None of the time bar is a holy grail or perfect. So that should be fine.. and basis different timebar, you are not overlooking anything.

Re. closing of long position, I have already posted, that since I was busy watching options trade, I closed the long, though as per our system we needed a confirmation that the price had to close below the signal bar. (Also posted that even if SAR signal is generated, after a directional run, it is not advisable to take it, as by experience it has proved to be a low probability trade)

My 2C
Agreed, there maybe difference in start of Time bar, however feel that the Supertrend value may not differ so much ! Its just a speculation, I dont actually know it.
DSM, You must have priority for you actual trades , no doubt....., I know this first hand as I myself am unable to Post while trading. This extra effort of yours is appreciated which aims to help others too! So maybe you need to give some "extra extra" effort , if this thread is to achieve its goal ! Either we can have someone who also uses the same Set up as you to Post the 'observation' in RT or simply the trade may be tracked in RT and the same Posted later.
I am not volunteering as I know I cannot do it, dont find time with my own Intra Day trading. :eek:
Was there an exit in Nifty Long as per your chart ? Please post the same, or simply post the values of Supertrend with time of the candles near exit !
DSM, Noted your observation about not taking a SAR after directional run ! It seems to be logical too. This surely dilutes the "mechanical' character of our system. What alternate do we have to remain as mechanical as possible ! ?
We have to keep in mind the main aim of this thread :

The idea for this thread is to check the outcome of trades based on a well defined mechanical system
We either ignore directional run and continue to trade normally. If not , then we need to have a rule for trades after a 'directional run' (DR) ? For that we need to clearly have a view : What is a directional RUN/How do we define directional run? How do we take trade after directional run? Do we switch to options after DR? We skip a trade after DR?

BTW, in Nifty did the candle close below Supertrend in your charts. I also find "chart anomaly' in BNF ! In my charts BNF closed below the ST on 31st whereas it closed in your charts on 30th ! In my charts the Short in BNF did not trigger, if a filter of 10 points was applied, we remained Long ! So this difference in data can really change the 'results' !
 

DSM

Well-Known Member
#72
RKK Sir,

As stated earlier the rational for the thread in real time is to take signals as they appear. To track the same in real time, provides us inputs and insights as to how to trade BETTER. As we move along, we will continue to get better insights....

There may be a delay in live posting of trades, or it may happen EOD as well, though my endeavor is to post it as close to actual signals as it happens. Anybody else wishing to post their entries and exits is fine.... no issues, though I will continue to track and analyse my trades.

Regarding exit of Nifty long, I will post the chart later during the day, however as stated, the price was below the signal, but closed above and hence not an exit as per rules. Had to take a call - since I had a few live charts and trades of mine to watch as well.... hence posted exit of long, but did not mention SAR as I was not sure if where the bar would finally close.

We need to check and track and analyze charts and once we have done so and are familiar with the nature of the system (Supertrend), the indice traded (Nifty/BankNifty/Future stock) we will have a better understanding of how to trade each - as the indice or the future stock will have it own quirks and behavior patterns.

Re. Directional Run, we need to look at past data, and see how many days the indices move directionally without retracement or correction? The same potential exist as per past observation - or more, as we cannot say that the patterns that we have observed are the only ones existing.... but looking at the past data can give us something to work on.

If we look at two charts 10D30M2ST and say 5D10M2ST, we can observe if the price is moving between the high and the low - that is choppy period. A break above/below (with a filter) can be stated as a likely directional move. We will have to define this as we go along, and it will be clear from the charts, as we post them (which I shall do later) So to answer your question is a consolidation or price moving in a band + filter (say 25 points) is to be taken as within the range. For this we can buy the lows and sell the highs with SL filter, once the price move back into the range after breaking it with a few points, and expect it to be within a range. We will have to study this aspect as we move on.

Re. difference in chart and data, I don't think what I am using or what somebody else is using is holy grail. I would tend to stick to data and follow the chart pattern that I have on the screen.

My 2C

Agreed, there maybe difference in start of Time bar, however feel that the Supertrend value may not differ so much ! Its just a speculation, I dont actually know it.

DSM, You must have priority for you actual trades , no doubt....., I know this first hand as I myself am unable to Post while trading. This extra effort of yours is appreciated which aims to help others too! So maybe you need to give some "extra extra" effort , if this thread is to achieve its goal ! Either we can have someone who also uses the same Set up as you to Post the 'observation' in RT or simply the trade may be tracked in RT and the same Posted later.
I am not volunteering as I know I cannot do it, dont find time with my own Intra Day trading. :eek:
Was there an exit in Nifty Long as per your chart ? Please post the same, or simply post the values of Supertrend with time of the candles near exit !
DSM, Noted your observation about not taking a SAR after directional run ! It seems to be logical too. This surely dilutes the "mechanical' character of our system. What alternate do we have to remain as mechanical as possible ! ?
We have to keep in mind the main aim of this thread :

We either ignore directional run and continue to trade normally. If not , then we need to have a rule for trades after a 'directional run' (DR) ? For that we need to clearly have a view : What is a directional RUN/How do we define directional run? How do we take trade after directional run? Do we switch to options after DR? We skip a trade after DR?

BTW, in Nifty did the candle close below Supertrend in your charts. I also find "chart anomaly' in BNF ! In my charts BNF closed below the ST on 31st whereas it closed in your charts on 30th ! In my charts the Short in BNF did not trigger, if a filter of 10 points was applied, we remained Long ! So this difference in data can really change the 'results' !
 

DSM

Well-Known Member
#73
Our current position is as follows :

Nifty : No position
BankNifty : Long @ 11,305

Currently BankNifty is @ 11,688 so our SL for the trade will be either the signal or 150 points (as per our rules)

Accordingly we are to be stopped out of position as per rule @ 11,538 or as per signal 11,498

As this is a SAR system, we will go short ON CLOSING OF THE 30M BAR below the signal.

Will update on this as it happens....
 

DSM

Well-Known Member
#74
Attaching Chart of 30M2ST for Nifty and BankNifty.

I have made an inadvertent error in posting the exit of Nifty @ 6,244 whereas it should have been at the lowest bar @ 6,284 Will update the XL tracker accordingly.



 

mastermind007

Well-Known Member
#75
Here is the my trade for last week in 30 min nifty...still this short intact taken at 24th


What is significance of so many arrows? At first I thought they were extra signals but then realized that you've colored 'em differently. so maybe you have some color scheme.
 

DSM

Well-Known Member
#76
Trailing SL Revised

Our current position is as follows :

Nifty : No position
BankNifty : Long @ 11,305

Currently BankNifty is @ 11,688 so our SL for the trade will be either the signal or 150 points (as per our rules)

Accordingly we are to be stopped out of position as per rule @ 11,538 or as per signal 11,498 / Currently BankNifty @ 11,720. Trailing SL @ 11,570 or 11,545

As this is a SAR system, we will go short ON CLOSING OF THE 30M BAR below the signal.

Will update on this as it happens....
 

mastermind007

Well-Known Member
#77
DSM,

What AFL do you use?

I got one from marketcall and improved it a bit which is here. Hope you do not mind its posting here in your thread

Code:
_SECTION_BEGIN("SuperTrend");
	// Author of www.marketcalls.in : Rajandran R; Reedited by Mastermind007
	// http://www.traderji.com/amibroker/90119-simple-coding-help-no-promise-7.html#post874442
	//http://www.marketcalls.in/amibroker/super-trend-intraday-afl-code-for-amibroker.html
	//http://www.actfx.com/Download50068.aspx

	SetBarsRequired(100000,0);

	GraphXSpace = 15;
	SetChartOptions(0,chartShowArrows|chartShowDates);
	
	Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

	//Plot(MA(C, 10), "MAC10", colorBlueGrey);

	Factor=Optimize("Factor",2,2,10,1);
	Pd=Optimize("ATR Periods",11,1,20,1);
	//Factor=1.5;Pd=1; // ATR 1: CCI 1.5

	PVT      = (High+Low)/2;
	atrValue = ATR(Pd);
	upperLevel = PVT + (Factor* atrValue);
	lowerLevel = PVT - (Factor* atrValue);

	TrendUp = Null;
	TrendDown = Null;
	trend[0] = 1; // assume bullish

	for (i = 1; i <BarCount-1; i++)
	{
		TrendUp[i] = Null;
		TrendDown[i] = Null;
		trend[i] = 1; // Assume Bullish 
		
		if (Close[ i ] > upperLevel[i-1])
		{
			trend[i] = 1; // 1 is bullish

		} else if (Close[i] < lowerLevel[i-1])
		{
			trend[i] = -1; // -1 is bearish
		} 
		else
		{
			trend[i] = trend[i-1];
		}

		// Prevent lower level from dropping during Bullish trend
		if (trend[i] > 0)
		{
			if (lowerLevel[i] < lowerLevel[i-1])
				lowerLevel[i] = lowerLevel[i-1];

			TrendUp[i] = lowerLevel[i];

			// Has past trend Changed
			if (trend[i-1] == -1)
				TrendUp[i-1] = TrendDown[i-1];
		}

		// Prevent upper level from rising during Bearish trend
		if (trend[i] < 0)
		{ 
			if (upperLevel[i] > upperLevel[i-1])
				upperLevel[i] = upperLevel[i-1];

			TrendDown[i] = upperLevel[i];

			if (trend[i-1] == 1)
				TrendDown[i-1] = TrendUp[i-1];
		}
	} 
	
	Plot(IIf(trend == 1, TrendUp,TrendDown), "Trend",IIf(trend == 1, colorGreen, colorRed), styleNoTitle | styleThick);
	
	Cover = Buy = Ref(trend, -1) != 1 AND trend ==  1;
	Short = Sell= Ref(trend, -1) != -1 AND trend == -1;
	
	SetPositionSize( 1, spsShares ) ;
	
	BuyPrice=ValueWhen(Buy,C);
	SellPrice=ValueWhen(Sell,C);
	ShortPrice=ValueWhen(Short,C);
	CoverPrice=ValueWhen(Cover,C);

	_N(Title = EncodeColor(colorBlack) + "Super Trend mastermind007"
	+ Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorBlack) +
	" - " + Date() +" - " +EncodeColor(colorRed) 
	+"Op-" + O + "  " + "Hi-" + H + " " + "Lo-" + L + "  " + "Cl-" + C + "  Trend " 
	+ WriteIf(IsNull(TrendUp), "Down: " + NumToStr(TrendDown, 0.2, False), "Up: " + NumToStr(TrendUp, 0.2, False)) 
	+ "; Vol= "+ WriteVal(V, 0.0, False)+"\n"+ 
	EncodeColor(colorRed)+ WriteIf (Buy , " GO LONG / Reverse Signal at "+C+"  ","")+
	WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")+"\n"+EncodeColor(colorBlack)+
	WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
	WriteIf(Buy  , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","") + "\n {{VALUES}}");
_SECTION_END();
 

DSM

Well-Known Member
#78
MM, Good work and thanks for posting the AFL. It will help many traders who are using or want to use Supertrend, and want to customise the settings. I do not use AFL - I just use TradeTiger, Supertrend, setting 30M, 2ATR

Ofcourse, like all indicators, Supertrend gives good results when a market is trending. Which indicators does not? Its one's familiarity to the indicator, and the script that is being traded that helps a trader get some additional juice from the market.

DSM,

What AFL do you use?

I got one from marketcall and improved it a bit which is here. Hope you do not mind its posting here in your thread

Code:
_SECTION_BEGIN("SuperTrend");
	// Author of www.marketcalls.in : Rajandran R; Reedited by Mastermind007
	// http://www.traderji.com/amibroker/90119-simple-coding-help-no-promise-7.html#post874442
	//http://www.marketcalls.in/amibroker/super-trend-intraday-afl-code-for-amibroker.html
	//http://www.actfx.com/Download50068.aspx

	SetBarsRequired(100000,0);

	GraphXSpace = 15;
	SetChartOptions(0,chartShowArrows|chartShowDates);
	
	Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

	//Plot(MA(C, 10), "MAC10", colorBlueGrey);

	Factor=Optimize("Factor",2,2,10,1);
	Pd=Optimize("ATR Periods",11,1,20,1);
	//Factor=1.5;Pd=1; // ATR 1: CCI 1.5

	PVT      = (High+Low)/2;
	atrValue = ATR(Pd);
	upperLevel = PVT + (Factor* atrValue);
	lowerLevel = PVT - (Factor* atrValue);

	TrendUp = Null;
	TrendDown = Null;
	trend[0] = 1; // assume bullish

	for (i = 1; i <BarCount-1; i++)
	{
		TrendUp[i] = Null;
		TrendDown[i] = Null;
		trend[i] = 1; // Assume Bullish 
		
		if (Close[ i ] > upperLevel[i-1])
		{
			trend[i] = 1; // 1 is bullish

		} else if (Close[i] < lowerLevel[i-1])
		{
			trend[i] = -1; // -1 is bearish
		} 
		else
		{
			trend[i] = trend[i-1];
		}

		// Prevent lower level from dropping during Bullish trend
		if (trend[i] > 0)
		{
			if (lowerLevel[i] < lowerLevel[i-1])
				lowerLevel[i] = lowerLevel[i-1];

			TrendUp[i] = lowerLevel[i];

			// Has past trend Changed
			if (trend[i-1] == -1)
				TrendUp[i-1] = TrendDown[i-1];
		}

		// Prevent upper level from rising during Bearish trend
		if (trend[i] < 0)
		{ 
			if (upperLevel[i] > upperLevel[i-1])
				upperLevel[i] = upperLevel[i-1];

			TrendDown[i] = upperLevel[i];

			if (trend[i-1] == 1)
				TrendDown[i-1] = TrendUp[i-1];
		}
	} 
	
	Plot(IIf(trend == 1, TrendUp,TrendDown), "Trend",IIf(trend == 1, colorGreen, colorRed), styleNoTitle | styleThick);
	
	Cover = Buy = Ref(trend, -1) != 1 AND trend ==  1;
	Short = Sell= Ref(trend, -1) != -1 AND trend == -1;
	
	SetPositionSize( 1, spsShares ) ;
	
	BuyPrice=ValueWhen(Buy,C);
	SellPrice=ValueWhen(Sell,C);
	ShortPrice=ValueWhen(Short,C);
	CoverPrice=ValueWhen(Cover,C);

	_N(Title = EncodeColor(colorBlack) + "Super Trend mastermind007"
	+ Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorBlack) +
	" - " + Date() +" - " +EncodeColor(colorRed) 
	+"Op-" + O + "  " + "Hi-" + H + " " + "Lo-" + L + "  " + "Cl-" + C + "  Trend " 
	+ WriteIf(IsNull(TrendUp), "Down: " + NumToStr(TrendDown, 0.2, False), "Up: " + NumToStr(TrendUp, 0.2, False)) 
	+ "; Vol= "+ WriteVal(V, 0.0, False)+"\n"+ 
	EncodeColor(colorRed)+ WriteIf (Buy , " GO LONG / Reverse Signal at "+C+"  ","")+
	WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")+"\n"+EncodeColor(colorBlack)+
	WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
	WriteIf(Buy  , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","") + "\n {{VALUES}}");
_SECTION_END();
 

DSM

Well-Known Member
#79
BankNifty Made an high of 11,780, and as per rule of giving away 150 points max, our SL should have been 11,630. However, this was not posted, so instead will continue with previous post - will consider SL exit @ 11,538

Not posted in real time, but today's BankNifty closed below signal on 30M Chart @ 11,627 The price moved down to 11,571 and the current price is also 11,627 So will consider the Short entry @ 11,627 SL @ close of 30M bar above 11,715 Max SL 150 points so forced exit will be @ 11,777

Nifty Short considered @ 6,323 as per 30M bar close below signal. SL as per signal is 6,330

Will update XL tracker later.

Our current position is as follows :

Nifty : No position
BankNifty : Long @ 11,305

Currently BankNifty is @ 11,688 so our SL for the trade will be either the signal or 150 points (as per our rules)

Accordingly we are to be stopped out of position as per rule @ 11,538 or as per signal 11,498
As this is a SAR system, we will go short ON CLOSING OF THE 30M BAR below the signal.

Will update on this as it happens....
 

Similar threads