Nifty Futures Trading

Status
Not open for further replies.
V

vvvv

Guest
Re: Time to Stick my Neck Out ,Nifty 7300

I think the afl code was already posted in the thread for kol indicator

Code:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("Kolkata Meet - Bands");
//..........................................................................

a = Param("Angle Degrees",30,15,90,15);
n = Param("Slope_Bars",5,10,50,1);

a    = (22 / 7) * (a / 180);

Num = NumL = NumH = 0;
Den = 0;

for (i = 1;i < n+1;i++)
{
	Num  = Num  + sin(i * a) * Ref(C,-i-1);
	NumL = NumL + sin(i * a) * Ref(L,-i-1);
	NumH = NumH + sin(i * a) * Ref(H,-i-1);
	Den = Den + sin(i * a);
}

j  = Num/Den;
jL = NumL/Den;
jH = NumH/Den;

//Plot(j, "Slope", IIf(j > Ref(j,-1), colorBlueGrey,colorLime), styleThick | styleDashed);
Plot(jL, "LB", colorLime,styleThick | styleDashed);
Plot(jH, "UB", colorBlueGrey,styleThick | styleDashed);

_SECTION_END();

_SECTION_BEGIN("Signal 04");
Buy  = C > jH;
Sell = C < jL;

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

Short = Sell;
Cover = Buy;

Short = ExRem(Short,Cover);
Cover = ExRem(Cover,Short);
_SECTION_END();


_SECTION_BEGIN("Plot Arrows");
//Position size fixed 100 units
SetPositionSize(100,4);
SetTradeDelays(1,1,1,1);


PlotShapes(shapeUpArrow * Buy, colorBlue,0, L,-20);
PlotShapes(shapeDownArrow * Short, colorRed,0, H, -20);
_SECTION_END();
Just hope the moderators don't ban me for posting code in this thread :)

My testing showed works better with higher time frames (hourly and above) found it tough to use with smaller TFs like 2/3/5/ mins..., anyway Goutam is already successfully using it on smaller TFs, so choose what suits you.

Please backtest, forward test, paper trade or any which way you can, just be sure before using in RT.

Regards
Sanjay
hi sanjay,
pls provide the back testing settings used to back test this indicator & other indicators in amibroker.also how are u forward testing it??
 

lvgandhi

Well-Known Member
Re: Time to Stick my Neck Out ,Nifty 7300

I think the afl code was already posted in the thread for kol indicator

Code:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("Kolkata Meet - Bands");
//..........................................................................

a = Param("Angle Degrees",30,15,90,15);
n = Param("Slope_Bars",5,10,50,1);

a    = (22 / 7) * (a / 180);

Num = NumL = NumH = 0;
Den = 0;

for (i = 1;i < n+1;i++)
{
	Num  = Num  + sin(i * a) * Ref(C,-i-1);
	NumL = NumL + sin(i * a) * Ref(L,-i-1);
	NumH = NumH + sin(i * a) * Ref(H,-i-1);
	Den = Den + sin(i * a);
}

j  = Num/Den;
jL = NumL/Den;
jH = NumH/Den;

//Plot(j, "Slope", IIf(j > Ref(j,-1), colorBlueGrey,colorLime), styleThick | styleDashed);
Plot(jL, "LB", colorLime,styleThick | styleDashed);
Plot(jH, "UB", colorBlueGrey,styleThick | styleDashed);

_SECTION_END();

_SECTION_BEGIN("Signal 04");
Buy  = C > jH;
Sell = C < jL;

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

Short = Sell;
Cover = Buy;

Short = ExRem(Short,Cover);
Cover = ExRem(Cover,Short);
_SECTION_END();


_SECTION_BEGIN("Plot Arrows");
//Position size fixed 100 units
SetPositionSize(100,4);
SetTradeDelays(1,1,1,1);


PlotShapes(shapeUpArrow * Buy, colorBlue,0, L,-20);
PlotShapes(shapeDownArrow * Short, colorRed,0, H, -20);
_SECTION_END();
Just hope the moderators don't ban me for posting code in this thread :)

My testing showed works better with higher time frames (hourly and above) found it tough to use with smaller TFs like 2/3/5/ mins..., anyway Goutam is already successfully using it on smaller TFs, so choose what suits you.

Please backtest, forward test, paper trade or any which way you can, just be sure before using in RT.

Regards
Sanjay
Thank you very much,
 

SGM

Active Member
Re: Time to Stick my Neck Out ,Nifty 7300

hi sanjay,
pls provide the back testing settings used to back test this indicator & other indicators in amibroker.also how are u forward testing it??
Hello

Here's the settings, mostly default or in the code.

You will not be able to emulate Gautam's results in the back test, the afl uses lower band for sell/short and upper band for buy/cover, where as gautam is doing it the other way.

Another difference, it seems from his post that after taking the signal he is ignoring all the other indicator signals till the current position is closed. In other words once in the trade he is using price action for managing the trade and not really bothered about what the indicator is indicating. Quite valid way of doing it.

But the biggest difference will be he stops trading after few trades (Profit / Loss targets achieved).

Hello Asish

Is there a way to shift the posts related to Kol indicator, to its thread, it would be good to have all the relevant posts in one place.

regards
Sanjay
 

Attachments

SGM

Active Member
Re: Time to Stick my Neck Out ,Nifty 7300

I have set rules, written on paper to read and ffollow....

Let me try to explain as best possible :
Hello Goutam

Plz cut out the sir part, just the name should do

Its good that you have written rules which you follow, not many here can say that :)

I will skip reading again thru the explanation part as don't want to put more energy into it. One thing is clear though that you are not taking all the crosses of the price/close on the bands, and using price action(H/L) based rules to manage the trade. Good as it is working out for you.

Just hope that those who intend to use Kol Indicator got to learn something from these interactions.

Regards
Sanjay
 

rkkarnani

Well-Known Member
Re: Time to Stick my Neck Out ,Nifty 7300

Hello Goutam

Plz cut out the sir part, just the name should do

Its good that you have written rules which you follow, not many here can say that :)

I will skip reading again thru the explanation part as don't want to put more energy into it. One thing is clear though that you are not taking all the crosses of the price/close on the bands, and using price action(H/L) based rules to manage the trade. Good as it is working out for you.

Just hope that those who intend to use Kol Indicator got to learn something from these interactions.

Regards
Sanjay
Thanks Sanjay for encouraging words for Gautam.... He is a quick learner and should do good in trades!!!!
A small word of praise from a senior goes a loooooooong way for a new commer!!!
Thanx again.
Regards
R K Karnani
 
V

vvvv

Guest
Re: Time to Stick my Neck Out ,Nifty 7300

Hello

Here's the settings, mostly default or in the code.

You will not be able to emulate Gautam's results in the back test, the afl uses lower band for sell/short and upper band for buy/cover, where as gautam is doing it the other way.

Another difference, it seems from his post that after taking the signal he is ignoring all the other indicator signals till the current position is closed. In other words once in the trade he is using price action for managing the trade and not really bothered about what the indicator is indicating. Quite valid way of doing it.

But the biggest difference will be he stops trading after few trades (Profit / Loss targets achieved).

Hello Asish

Is there a way to shift the posts related to Kol indicator, to its thread, it would be good to have all the relevant posts in one place.

regards
Sanjay
thnks sanjay for the stuff.
i thing this is more or less the settings used for most of the stocks.i think u have used mini - nifty for the settings.
for the long trades im using the following:

buy price = close , buy delay = 0; sell price = open , sell delay = 1;
or buy price = high , buy delay = 1;sell price = open , sell delay = 1;

hope im not wrong.
 
U

uasish

Guest
Re: Time to Stick my Neck Out ,Nifty 7300

4936.35 if does not hold for another 25 mins then not squaring up the remaining 25 %.
 
U

uasish

Guest
Re: Time to Stick my Neck Out ,Nifty 7300

Placing a Stop for the Shorts @ 4963.10.

May reverse to Longs but another 20 mins chart is imp.
 
Status
Not open for further replies.

Similar threads