Discussion on kolkata meet signal

V

vvvv

Guest
#31
Hello Vikram

From your chart, it seems you would get decent gains if you had taken the third entry after the first 2 getting stopped out.

Have you checked with other charts, if yes, what was your observation from those other examples? According to you how many stops in a row would make a system unuseable?

Regards
Sanjay
havent checked a lot of charts but i like to go for charts which are choppy & no definable trend.
will try to apply on sum other chart & post it.
the question is not how many stops in a row.say u hold a future position according to the chart ive given & u loose 2 times in a row.wud u be in a position mentally to take the 3rd trade.
also if u put too tight stops then there are more chances to be stopped out on a good winning trade,so u have to give sum leaveway.
i am attaching the renko chart of aban with a brick size = 100 with the indicator on top of it.i think the stuf is self explanatory
so the thing to be considered is :
1)if i trade a simple renko which takes me 1 min to understand,i win most of the time with stop below the 1st brick
2)shud i go for indicators & oscillators & stuff like tht.
3)can u take a trade solely on the kol meet indicator or u have to use sumthing else in conjunction with it.
for ex : ive read in books candlesicks works best with stochastics.

wht do u suggest????

N.B. wanted to clear sum doubts of mine regarding the renko.
 
Last edited by a moderator:

kkseal

Well-Known Member
#32
Study MAs first - their construction, pros & cons, watch them on charts & you'll get your answers No point in rushing into 'crocodiles' & 'butterflies' without knowing the basics.

Regards,
Kalyan.
 

SGM

Active Member
#33
Hello

Yesterday Asishda send me some metastock code to be converted to Amibroker afl and post on the forum, I guess his intention was to provide an open code so that the collaboration effort can continue.

He also asked me to do back tests and publish the performance.

Regards
Sanjay


So here we go.

Original Code
Code:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

K:= C;
a:=30;
S1:=Sin(1*a)*K;
S2:=Sin(2*a)*Ref(K,-1);
S3:=Sin(3*a)*Ref(K,-2);
S4:=Sin(4*a)*Ref(K,-3);
S5:=Sin(5*a)*Ref(K,-4);
Num:=S1+S2+S3+S4+S5;
Den:=Sin(a)+Sin(2*a)+Sin(3*a)+Sin(4*a)+Sin(5*a);
j1:= Num/Den;
j1;

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 

SGM

Active Member
#34
Code translated into an AFL
Code:
_SECTION_BEGIN("Asish_Indicator_01");

a  = Param("Len",30,15,45,1);

Num = sin(1*a) * C + sin(2*a) * Ref(C,-1) + sin(3*a) * Ref(C,-2) + sin(4*a) * Ref(C,-3) + sin(5*a) * Ref(C,-4);
Den = sin(a) + sin(2*a) + sin (3*a) + sin(4*a) + sin(5*a);
j1 = Num / Den;
_SECTION_END();
 

SGM

Active Member
#35
The original code did not have any buy / sell conditions but gave us a wiggly (j1) when plotted on the charts.

The most common things we can do with wigglies is

  1. To use the direction (slope) as a signal to go long / short

  2. Use close to decide buy /sell, buy when close is above, sell when below the wiggly

I have back tested the code only using 1, will also provide code for 2, so members can even test for that. You can also add to this list.

Code:
_SECTION_BEGIN("Asish_Indicator_01");

a  = Param("Len",30,15,45,1);

Num = sin(1*a) * C + sin(2*a) * Ref(C,-1) + sin(3*a) * Ref(C,-2) + sin(4*a) * Ref(C,-3) + sin(5*a) * Ref(C,-4);
Den = sin(a) + sin(2*a) + sin (3*a) + sin(4*a) + sin(5*a);
j1 = Num / Den;
Plot(j1,"j1",IIf(j1 > Ref(j1,-1),colorBlueGrey,colorLime),styleThick);

_SECTION_END();

_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("Signal01");
Buy  = j1 > Ref(j1,-1);
Sell = j1 < Ref(j1,-1);

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

Short = j1 < Ref(j1,-1);
Cover = j1 > Ref(j1,-1);

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

//Position size fixed 100 units
SetPositionSize(100,4);
SetTradeDelays(1,1,1,1);

PlotShapes(shapeUpArrow * Buy, colorBlue,0, L,-10);
PlotShapes(shapeDownArrow * Short, colorRed,0, H, -10);
_SECTION_END();
The red/blue arrows on the charts are courtesy Karthik, years back he taught me that :)
 

SGM

Active Member
#36
The back test reports

For backtesting Ami backtester was used.

Brokerage of 2 points is considered for every trade (1 point on each side).

All 6 runs are done with EoD data.

After the signal is triggered buy/sell price is considered as the next bar's open price.

No slippage is considered.

Initial Capital 500000

Backtest Summary for Spot Nifty EoD, with default settings.
Code:
	Period			Trades	win	Loss	Net Gain/Loss in Points

01 Jan 2008 - April 17 2008	33	15	18		899


01 Jan 2007 - Dec 31 2007	122	46	76		-9	


01 Jan 2000 - Dec 31 2006	812	330	482		-1978
I do not have much faith in the process of brute force optimization, but for the sake of completeness have also given optimized reports. Please note that the back test results for the optimized versions are the best case ones, and are achieved by curve fitting.
 
Last edited:

SGM

Active Member
#37
The code for Above/Below Condition

Code:
_SECTION_BEGIN("Signal 02");
Buy  = C > j1;
Sell = C < j1;

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

Short = Sell;
Cover = Buy;

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

//Position size fixed 100 units
SetPositionSize(100,4);
SetTradeDelays(1,1,1,1);

PlotShapes(shapeUpArrow * Ref(Buy,-1), colorBlue,0, L,-10);
PlotShapes(shapeDownArrow * Ref(Short,-1), colorRed,0, H, -10);

_SECTION_END();
To change from fixed position sizing (100) to Money based sizing, say 100,000
Replace

SetPositionSize(100,4); with SetPositionSize(100000,1);
 

SGM

Active Member
#38
wosh, it took me more than double the time to post compared to code and backtest. Anyway, heres the last one with back test report of Nifty Futures

NF, EoD, 01 Jan 2008 - April 17 2008

NF, Hourly, 01 Jan 2008 - April 17 2008

Please do your own test before drawing any conclusions. The code is available, so shouldn't be a problem to convert into anything.

Regards
Sanjay
 
Last edited:
V

vvvv

Guest
#40
wosh, it took me more than double the time to post compared to code and backtest. Anyway, heres the last one with back test report of Nifty Futures

NF, EoD, 01 Jan 2008 - April 17 2008

NF, Hourly, 01 Jan 2008 - April 17 2008

Please do your own test before drawing any conclusions. The code is available, so shouldn't be a problem to convert into anything.

Regards
Sanjay
are u sure that the afl is correct.the code for metastock gives a smooth curve but the afl gives a highly choppy curve.
moreover the line's for the kolkata meet indicator & the one in which the code is given doesnt match
 

Similar threads