EMA Crossover system -- huge earning potential

myamit

Well-Known Member
#21
BUT

what if the Index leaders are in the Red .. say like Infy itself took the markets down like mad ...

What if only RIL is red the balance green .. then ... still RIL itself can take on the whole of the other 49 stocks and take the index down ...

Hello SM,

This is exactly what I have said. By strong stock I meant index heavy weight. Now when they are trending i.e. -T line will be going north & +T line will also be going north (as other stocks are in green). However majority of the stocks will represent NT line & its direction will determine strength of the trend.

Anyway, this is still a very premature thought and I'm still gathering building blocks for this indicator.
 

AW10

Well-Known Member
#23
As of now this is only a thought. My basic assumption is that change in Nifty is being determined as a difference between positive & negative stocks (contributing +/- 0.25%). I may filter stocks that are in range of -0.25% to 0.25%.
I also wish to consider their behavior in Intraday V/s short term (7-10 days), their major support/resistance levels etc.

Basically this will give me a three line indicator (something like ADX) which tells me strength & values of positive (+T), negative (-T) & neutral stocks (NT). Now more like ADX values, I may use them & see their values at the time of EMA cross-over.

I'm assuming that for a successful trade, I need to have few leaders & many followers. So I may take trade only when +T is getting positive & NT is high.

Anyway... once again this is just a thought. It may work -- may not.

All views/comments are appreciated.
Amit, expressing my view on the discussion in this thread. Good to see that you have a profitable system, but bit disappointed to see the direction it is taking where u are trying to remove whipsaw/sideway mkt etc.

First on your new indicator of +T/-T/NT - Did you read about index calculation and how the compenents reflect in final value.
One of the important input variable is the "weightage as per market cap".
All 50 components of nifty don't have same impact on final value.

So if top 5 counters are down, even after 45 being in +, nifty might still be going down.

I think, you are complicating the original system (basic MA crossover system). One of my key rule of trading is = keep it simple.
You are trying to avoid whipsaw or trying to identify sideway market, which generally complicates the system and still you will have whipsaws cause mkt is dynamic. So you will endup in perpetual tinkering your systems without getting real consistency.
I think you also mentioned about optimisation and picking up the best value of Moving Averages. To me, that is as far from reality as it can be. I put emphasis on understanding the lookback period of MA, why the hell it should work, is anybody else watching it or I am only guy taking decision based on it. The optimised value will highly depend on your historical database, and after 1 month these numbers will change cause data has changed now. Again, to me, it doesn't give me solid base for gaining consistency and confidence on the result of system.

My suggestion will be to look at risk mgmt, position sizing, re-entry etc to get best from it rather than trying to perfect entries. In broader picture of trading, contribution of entry is not that much, but as a system developer we end up spending most of the time in it.
Try to get deeper into the result distribution of the system, their stnd dev, probability, worst case, best case.. do some simulation to get thorough understanding of output..and use the variables like position size (why shd u risk only 1% - is it just because some guru has told it or you have better reason than that), exits, trailing stops etc.

That's just my view. Hope this helps. All the best
Happy Trading
 

tnsn2345

Well-Known Member
#24
I am taking liberty to post below my PM response to Myamit's query...this I felt so since there are quite a few friends here following this thread and may be this could add some dimension to their thinking.

tnsn2345 said:
myamit said:
....feel that I need your assistance in improving one of my system. May I request you to visit my post at and give your advice on particular issues or improvements & AFL coding. Thank you very much

http://www.traderji.com/advanced-tr...system-huge-earning-potential.html#post540557
.....
Myamit,

I have visited your thread and appreciate your good effort to develop a system / trading rule. I recollect my days a few years ago when I too was deeply fascinated with such system and used to spend hours creating such system. Over the last few years I have moved to a different approach to trade, which is more discretionary method by reading the markets by using candlestick charts. There are other mathematical models also which I use but they are just to scan the market, the decision to enter and exit is pure discretionary for intraday or for longer period of trades.

I do not know much about AFL since I do not require one for my trading and have never used / developed any AFL.

My only advise to you on your system is that like any other system, they are not suited for all type of markets dynamics. You will also have to define the type of market condition when you would like to use this (or any other such system/methdo) and use it only during such markets. And this in my opinion is a very difficult task - to define different type of markets. If you are deeply interested and are committed then you may first broadly define 3 /4/5 types of market conditions and then create such system (which will be nothing but a minor modification of your existing system) and then use it for trading. But this will require a great committment and patience. I, for one quit developing such system a few years ago since I was too exhausted.

Regards,
My response is my personal experience and as I meet new people and see institutions there are many who have such propriterary trading rules based on similar trading systems.

Regards,
 

myamit

Well-Known Member
#25
Amit, expressing my view on the discussion in this thread. Good to see that you have a profitable system, but bit disappointed to see the direction it is taking where u are trying to remove whipsaw/sideway mkt etc.
Dear AW10,

First of all, let me thank you for your time & concerns. I fully agree with all your views..
-- to keep system simple
-- not to optimize it too much (as data & market are dynamic)

Let me explain my thought process...
For SL, I'm keeping it around 20 points (but exit only at bar stop). Reason for keeping such small stop loss is that anyway I'm getting in the trade very late & hence strong uptrend has already been established. Secondly, this is the number that worked best for my profile. I'm always driven by two thoughts ....
-- limit initial losses (allowing me to increase my position size)
-- to generate higher positive trades (allowing me to stick to the system)

I may not be looking for fully optimized results as my priority is to have higher positive trades. I also understand that back tested results cannot be generated again (owing market's dynamic nature) and hence any such optimization can be considered as guideline but not the "Absolute Truth".

For making indicator like ADX, I think it is my fault to put premature idea in public domain. I agree with your thoughts (about market cap, index heavy weight) and exactly those are my guiding points. However I guess I should first firm up base plan & than discuss.

Lastly, I'm working on re-entry/adding position, risk mgmt etc. I agree that this system can generate better results with those ideas added. Please feel free to share any ideas that you feel appropriate for these topics.

Once again thank you very much for your time & comments. I really feel great about this forum & members.

Happy trading!
 
#26
Hi myamit,

First of all, thank you for all your efforts.
Have you tried this system with the daily charts? How suitable this system would be in that time frame?
 

myamit

Well-Known Member
#27
Hi myamit,

First of all, thank you for all your efforts.
Have you tried this system with the daily charts? How suitable this system would be in that time frame?
I've tried to work out various possibilities in daily timeframe. However none was effective. Infact I prefer & wanted to have something for daily timeframe.

If you (or anybody) has any thoughts to tweak this system for daily time-frame, please share.
 

myamit

Well-Known Member
#28
Friends,

I need some help in AFL coding for this system. I wish to add one more condition for Entry.

Currently my entry is at the cross over of FastAvg & SlowAvg. However I wish to enter when price closes above SlowAvg or avg crossover whichever happens first.

However price closes above SlowAvg should check...
1. System is not in trade (if in trade than do not enter in trade)

2. Last trade must be on other side. i.e. for if my last trade is buy trade than system should look for price to close below slowAvg & vice versa.

Please advice.
 

msa5678

Well-Known Member
#29
Friends

I have received few requests to post afl for this. I actually wanted to post ....Clipped...


Hi Amit,

I have added "Buy@" , "Sell@", "Short@"
and "Cover@" indicators. Will change Color
and shapes of Arrows in the next post, Here
is the modified AFl....

SetOption("EveryBarNullCheck", True);
SetChartOptions(0,chartShowArrows|chartShowDates | chartWrapTitle | chartLogarithmic);

_SECTION_BEGIN("Trading System");

Periods = Param("Fast Avg", 15, 2, 300, 1, 10 );
Plot( EMA( Close, Periods ), "Fast Avg", ParamColor( "Color-Fast", colorRed ), ParamStyle("Style") );

Periods = Param("Stop Avg", 21, 2, 300, 1, 10 );
Plot( EMA( Close, Periods ), "Stop Avg", ParamColor( "Color-Stop", colorBlue ), ParamStyle("Style") );

Periods = Param("Slow Avg", 52, 2, 300, 1, 10 );
Plot( EMA( Close, Periods ), "Slow Avg", ParamColor( "Color-Slow", colorGreen ), ParamStyle("Style") );

fa=15; //17;
sa=52; //49; //59;
st=21; //35;
InitStop = 20; //11;
TRStop = 40;// 84;


//FA = Optimize("FastAvg",15,10,33,1);
//SA = Optimize("SlowAvg",44,15,75,1);
//ST = Optimize("StopAvg",21,3,39,1);
//TRStop = Optimize("TrailingStop", 60,40, 100,1);
//InitStop = Optimize("Initial Stop", 10,1,40,1);


ApplyStop(stopTypeTrailing, stopModePoint, TRStop, 0, False, 0);
ApplyStop(stopTypeLoss, stopModePoint, InitStop, 0, False, 0);


FastAvg = EMA(Close, FA);
SlowAvg = EMA(Close, SA);
StopAvg = EMA(Close, ST);

UpTrend = Cross(FastAvg, SlowAvg);
StopUpTrend = Cross( Max(SlowAvg, StopAvg), FastAvg);
downTrend = Cross(SlowAvg, FastAvg);
StopDownTrend = Cross(FastAvg, Max(SlowAvg, StopAvg));

Buy = UpTrend;
Sell = StopUpTrend;
Short = downTrend;
Cover = StopDownTrend;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorBlack, 0,Low,-15);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorBlack, 0,High,-15);
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorBlack, 0,Low,-25);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorBlack, 0,High,-25);

dist = 1.5*ATR(10);

for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist, colorBlack );
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist, colorBlack );
if( Cover ) PlotText( "Cover\n@" + C[ i ], i, H[ i ]+dist, colorBlack );
if( Short ) PlotText( "Short\n@" + C[ i ], i, H[ i ]+dist, colorBlack );}


t1= Flip(Buy,Sell);
t2= Flip(Sell,Buy);
BPrice=ValueWhen(t1 AND Ref(t1,-1)==0,C,1);
SPrice=ValueWhen(t2 AND Ref(t2,-1)==0,C,1);

Buyplus=(Bprice+20);
Buyminus=(Bprice-20);
Plot(Buyplus,"R1",colorGreen,styleLine|styleDashed|styleNoTitle);
Plot(Buyminus,"R2",colorGreen,styleLine|styleDashed|styleNoTitle);

Sellplus=(Sprice-20);
Sellminus=(Sprice+20);
Plot(Sellplus,"R3",colorRed,styleLine|styleDashed|styleNoTitle);
Plot(Sellminus,"R4",colorRed,styleLine|styleDashed|styleNoTitle);



//Settings for Backtesting to keep lot size fixed // Need help here
SetOption("MaxOpenPositions",1);
RoundLotSize = 50;
SetOption("MinShares",RoundLotSize);
PositionSize = C*50*2;
//End of Backtesting Settings for Backtester

//====================End of Trading System====================//


Hope this helps...
 

myamit

Well-Known Member
#30
Hello MSA5678,

Thank you for your help. Can you please confirm my understanding (as beow) of your code?

I understood that with ExRem you have removed multiple signals. So that only first signal will be considered. I also understood Buy@ concept.

However could you please explain following...
t1= Flip(Buy,Sell);
t2= Flip(Sell,Buy);
BPrice=ValueWhen(t1 AND Ref(t1,-1)==0,C,1);
SPrice=ValueWhen(t2 AND Ref(t2,-1)==0,C,1);
Also, I assume that Buyminus is the way to calculate stop loss. But I could not understand Buyplus. Similarly why Sellminus?

Also it would be great, if we can define a box (let's say upper left corner) and display all info as below.

Trade type
Entry price
Stop loss
Profit / Loss

Lastly, I wanted to know how I can determine whether I'm in trade or not.
I want to achieve following...
Currently my entry is at the cross over of FastAvg & SlowAvg. However I wish to enter when price closes above SlowAvg or avg crossover whichever happens first.

However price closes above SlowAvg should check...
1. System is not in trade (if in trade than do not enter in trade)

2. Last trade must be on other side. i.e. for if my last trade is buy trade than system should look for price to close below slowAvg & vice versa.

Thank you for all your help.
 

Similar threads