Experiments in Technical Analysis

karthikmarar

Well-Known Member
Some Notes about the NMA system

The NMA system contains two variable parameters, namely K and ATR. The performance of the system depends on these parameters. These can be adjusted from the Parameter window in AB. In order to get optimum performance we have to adjust these parameters for different markets and different time frames. A setting which is good for intraday may not be suitable for EOD based trading. One can find find the suitable values by running the optimizer in AB on a set of stocks for a particular time frame.. The Code is Optimization ready. Optimizing and backtesting on EOD data on Nifty 100 stocks has shown that for EOD values of K=2.5 and ATR=4 works quite nicely. However Hourly charts of nifty K=4 and ATR =8 seems to work much better.

regards
 
Hi,

It was not a planned discontinuation of the VSA thread. I had some health issues for quite some time. Now everything is resolved and I do plan to continue posting. Also the general lack of interest in TA in the forum was partly responsible for keeping me away from posting.

regards
Hi karthik,

Thanks for the thinking of restarting the VSA thread.I am egarly waiting for it.

Thanks :)
Avinash
 
hello
may be the code is incomplete
i have recently started learning metastock coding with mov av/ and rsi and basics
and with that using amibroker too
fitted this indicator in ami on nifty chart pretty good results say 2 failure out of 10 but before applying and trading i would first understand the logic of it
as karthikmarar says it iis based on ATR(average true range)/ i am using one such indicator based on period input 10and at times 14

rotoline


_SECTION_BEGIN("NICK MA Swing");
SetBarsRequired(200,0);

GraphXSpace = 5;
SetChartOptions(0,chartShowArrows|chartShowDates);
k = Optimize("K",Param("K",1,0.25,5,0.25),0.25,5,0.25);
Per= Optimize("atr",Param("atr",4,3,20,1),3,20,1);
HACLOSE=(O+H+L+C)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" + Name(), colorBlack, styleCandle | styleNoLabel );
j=Haclose;

this is the begining part of the code
 
Some Notes about the NMA system

The NMA system contains two variable parameters, namely K and ATR. The performance of the system depends on these parameters. These can be adjusted from the Parameter window in AB. In order to get optimum performance we have to adjust these parameters for different markets and different time frames. A setting which is good for intraday may not be suitable for EOD based trading. One can find find the suitable values by running the optimizer in AB on a set of stocks for a particular time frame.. The Code is Optimization ready. Optimizing and backtesting on EOD data on Nifty 100 stocks has shown that for EOD values of K=2.5 and ATR=4 works quite nicely. However Hourly charts of nifty K=4 and ATR =8 seems to work much better.

regards
hi thank u for the system:)
i like to know more about it wht do u mean by k and atr values is it a period value or something else
basically it is a hekinashi chart with a indicator
can u throw some light on the indicator abt hw is it constructed
back test results r good
 

karthikmarar

Well-Known Member
Dnana

It is nice to know that you would like to understand the logic behind the system before implementing the system instead of going with it blindly.

The system is based on a moving average proposed by a Russian Trader. Hats off to them, they have come up with some real nice stuff. But most of it is on Metatrader platform targeting Forex Trading.


In simple terms there is trailing stop reverse line which always remains a fixed distance or delta away from the recent peak price.

In an uptrend TS= Highest(Close,period) Delta
In a downtrend TS= Lowest(Close,period)+Delta

In our system the delta value is always a multiple (K) of a weighted moving average (Period: atr) of the spread. Hence by adjusting the K and atr values the delta can be adjusted.

I have tried to make it very simple. In case you need more information please inform.

Regards
 
Dnana

It is nice to know that you would like to understand the logic behind the system before implementing the system instead of going with it blindly.

The system is based on a moving average proposed by a Russian Trader. Hats off to them, they have come up with some real nice stuff. But most of it is on Metatrader platform targeting Forex Trading.


In simple terms there is trailing stop reverse line which always remains a fixed distance or delta away from the recent peak price.

In an uptrend TS= Highest(Close,period) Delta
In a downtrend TS= Lowest(Close,period)+Delta

In our system the delta value is always a multiple (K) of a weighted moving average (Period: atr) of the spread. Hence by adjusting the K and atr values the delta can be adjusted.

I have tried to make it very simple. In case you need more information please inform.

Regards
Hello

Thanks for the code. I liked the trick where you combined param & optimize, till date I used to edit the code to switch between them.

Code:
k = Optimize("K",Param("K",1,0.25,5,0.25),0.25,5,0.25) ;
Per= Optimize("atr",Param("atr",4,3,20,1),3,20,1);
Any specific reason for using HA candles?

Regards
PK
 
ith that using amibroker too fitted this indicator in ami on nifty chart pretty good results say 2 failure out of 10 but before applying and trading i would first understand the logic of it
as karthikmarar says it iis based on ATR(average true range)/ i am using one such indicator based on period input 10and at times 14

rotoline
Hello

I got about 50% win/Loss and not 80/85% (10 wins out of 12) as you have stated.

Maybe the SR lines flipping visually gave you that impression :).

Code:
[B]Ticker		Trade	Date		Price	Ex. date	Ex. Price	Profit	% Profit[/B]
NIFTY_F1	Long	4/11/2008 13:59	4812.8	5/7/2008 10:59	5130.8	315.02	6.55%
NIFTY_F1	Short	5/7/2008 10:59	5131	5/15/2008 15:59	5098	29.93	0.58%
NIFTY_F1	Long	5/15/2008 15:59	5099	5/22/2008 15:59	5011.95	-90.08	-1.77%
NIFTY_F1	Short	5/22/2008 15:59	5011	6/16/2008 10:59	4577	431.12	8.60%
NIFTY_F1	Long	6/16/2008 10:59	4575.05	6/19/2008 10:59	4515	-62.78	-1.37%
NIFTY_F1	Short	6/19/2008 10:59	4518	7/9/2008 10:59	4078	437.42	9.68%
NIFTY_F1	Long	7/9/2008 10:59	4078.1	7/11/2008 15:59	3999	-81.52	-2.00%
NIFTY_F1	Short	7/11/2008 15:59	3999	7/18/2008 15:59	4069	-72.42	-1.81%
NIFTY_F1	Long	7/18/2008 15:59	4068.9	7/25/2008 10:59	4362.7	291.27	7.16%
NIFTY_F1	Short	7/25/2008 10:59	4363	8/1/2008 13:59	4375.4	-15.02	-0.34%
NIFTY_F1	Long	8/1/2008 13:59	4377	8/12/2008 14:59	4555	175.32	4.01%
NIFTY_F1	Short	8/12/2008 14:59	4556	8/25/2008 11:59	4377.25	176.07	3.86%
NIFTY_F1	Long	8/25/2008 11:59	4377.45	8/28/2008 14:59	4263	-117.04	-2.67%
NIFTY_F1	Short	8/28/2008 14:59	4263	8/29/2008 13:59	4348	-87.58	-2.05%
NIFTY_F1	Long	8/29/2008 13:59	4348.5	9/10/2008 10:59	4458	106.86	2.46%
NIFTY_F1	Short	9/10/2008 10:59	4459.8	9/18/2008 15:59	4050	407.25	9.13%
NIFTY_F1	Long	9/18/2008 15:59	4050	9/25/2008 13:59	4095.8	43.36	1.07%
NIFTY_F1	Short	9/25/2008 13:59	4095.95	10/14/2008 10:59	3658	435.62	10.64%
NIFTY_F1	Long	10/14/2008 10:59 3660	10/15/2008 10:59	3457.1	-205.04	-5.60%
NIFTY_F1	Short	10/15/2008 10:59 3457.2	10/31/2008 11:59	2938.5	516.78	14.95%
NIFTY_F1	Long	10/31/2008 11:59 2938.1	11/6/2008 09:59	2920	-19.86	-0.68%
NIFTY_F1	Short	11/6/2008 09:59	2905.55	11/10/2008 15:59	3135	-231.26	-7.96%
NIFTY_F1	Long	11/10/2008 15:59 3132	11/11/2008 15:59	2936.7	-197.12	-6.29%
NIFTY_F1	Short	11/11/2008 15:59 2938	11/25/2008 09:59	2799	137.28	4.67%
NIFTY_F1	Long	11/25/2008 09:59 2777	12/2/2008 10:59	2587.8	-190.81	-6.87%
NIFTY_F1	Short	12/2/2008 10:59	2586	12/5/2008 09:59	2779	-194.61	-7.53%
NIFTY_F1	Long	12/5/2008 09:59 2792.8	12/24/2008 09:59	2959	164.47	5.89%
NIFTY_F1	Short	12/24/2008 09:59 2958.75	12/30/2008 10:59	2958.75	-1.78	-0.06%
NIFTY_F1	Long	12/30/2008 10:59	2959	1/7/2009 12:59	2969	8.22	0.28%
NIFTY_F1	Short	1/7/2009 12:59	2968	1/19/2009 09:59	2823.7	142.56	4.80%
NIFTY_F1	Long	1/19/2009 09:59	2816	1/21/2009 10:59	2739.4	-78.27	-2.78%
NIFTY_F1	Short	1/21/2009 10:59	2738.8	1/28/2009 09:59	2794.7	-57.56	-2.10%
NIFTY_F1	Long	1/28/2009 09:59	2787.1	1/30/2009 10:59	2772.65	-16.12	-0.58%
NIFTY_F1	Short	1/30/2009 10:59	2770.35	2/9/2009 09:59	2837	-68.33	-2.47%
NIFTY_F1	Long	2/9/2009 09:59	2833.5	2/16/2009 12:59	2863.65	28.44	1.00%
NIFTY_F1	Short	2/16/2009 12:59	2864	3/4/2009 15:59	2635	227.35	7.94%
						[B]2287.14[/B]
Backtest from 1st April 2008 till yeaterday on hourly timeframe gave Gains of 2287 points after brokerage, but the maximum system drawdown was of 1400 points and max trade DD is 651 points.

Will try this on still smaller timeframe for a smoother equity curve.

Regards
PK
 
Dnana

It is nice to know that you would like to understand the logic behind the system before implementing the system instead of going with it blindly.

The system is based on a moving average proposed by a Russian Trader. Hats off to them, they have come up with some real nice stuff. But most of it is on Metatrader platform targeting Forex Trading.


In simple terms there is trailing stop reverse line which always remains a fixed distance or delta away from the recent peak price.

In an uptrend TS= Highest(Close,period) Delta
In a downtrend TS= Lowest(Close,period)+Delta

In our system the delta value is always a multiple (K) of a weighted moving average (Period: atr) of the spread. Hence by adjusting the K and atr values the delta can be adjusted.

I have tried to make it very simple. In case you need more information please inform.

Regards
Thanks Karthik for the explanation. I had posted another request earlier for the same, but the post is missing:confused:
 

Similar threads