Lets develop a trading system...!

linkon7

Well-Known Member
#1
I use amibroker for my intraday trades. I am in the process of developing a system in amibroker but my knowledge in amibroker coding is very elementary. I solicit the help of fellow amibroker users to help me complete a system.

Of course every person has a different mind-set and risk taking ability. So everyone should have a different system that matches his style of trading.

My target is to trade nifty futures only. The primary reason is the liquidity of the options and hence the ability to hedge our positions for carrying it over the next day. Intention is to let my profits run.

The process of development will need to go through the following steps:

 

linkon7

Well-Known Member
#2
I am reproducing a content a good friend forwarded to me...


TREND, MOMENTUM, TIMING.
Please write this down on a piece of paper and tape it on your computer.
" I will not take a trade until I’ve identified the trend"
"If it ain’t going down ... THEN IT’S GOING BACK UP"
"If it ain’t going up ... THEN IT’S GOING BACK DOWN"

I want you to repeat that as often as possible, every day. That will be your trading mantra. That is the basic concept behind day trading. That is the reality of the market so ... DON’T OVER ANALYZE THE SITUATION. Accept the reality of the market and GO WITH THE FLOW. Learn to trade like you drive your car, a little aggressive at times, but always aware of everything around you and respectful of the traffic rules. The road hooks left ... you turn left. The road hooks right ... you turn right. Don't challenge the market ... roll with it and you'll always be rewarded.

TRADING DISCIPLINE.
In order to succeed at this business you must develop a trading discipline which is a reflex reaction, an autonomic response to changing conditions in the market. If you will, an intrinsic sense of what is going on around you.

When you drive your car you don’t just sit behind the steering wheel like a zombie. You’re alert, on guard and constantly monitoring your speed, engine performance, road hazards, traffic conditions and numerous other elements that may impact your safety and safety of others. Take a moment to reflect upon the complexities of driving an automobile. Your car is in the driveway right now. In order to go to the store you’ll need to execute many tasks simultaneously. You sit in the car and buckle up your seatbelt. Place the key into the ignition and fire up the engine. You engage the transmission in reverse while depressing the brake pedal. You look behind you and ease off the brake pedal while steering the car in reverse. That just gets you out of the driveway. Now you must maneuver 4000 pounds of steel to your destination without killing yourself or others around you. Take a farmer from the year 1850 and plunk him into an automobile with you today and he would be terrified and awestruck at the power of the machine and your incredible driving skills. Yet, you don’t consider driving to be a challenging task, in fact, it’s almost as natural as walking. That’s because you’ve developed a conditioned response to changing circumstances that occur minute by minute while driving. You’ve developed a discipline that allows you to operate in a comfort zone.

Day trading is not nearly as complex as driving a car and certainly less dangerous. Nonetheless, you need to develop a discipline in order to operate in a comfort zone. The first step is to repeat your trading mantra every time you turn on Metastock. We need to condition our mind to certain realities about the market. We are going to develop an autonomic response to changing conditions in the market.

This is not a gambling casino, sporting event or leisure activity. THIS IS A BUSINESS. You go for percentage gains and never try to hit the homerun. ALWAYS TRADE FOR SMALL PERCENTAGE GAINS. Bulls charge, Bears retreat and PIGS GET SLAUGHTERED
Never, NEVER hold on to a losing trade. When the indicators and the market turn against your position ... BAIL OUT. Don't hope and pray ... BAIL OUT. If you must suffer a loss ( and that's a reality in trading ) make it the smallest loss possible. On average, every 15 to 18 minutes will produce another trading signal. Cut the loss short and go to the sidelines until the next trade sets up. A good trader is patient, opportunistic and DISCIPLINED.

THE BASICS ARE CRITICAL
You are competing with the best minds in the investment industry. This is not a game. This is war and their mission is to take your money away from you. If you are not prepared and properly equipped to do battle ... YOU WILL LOSE!
YOU ARE NOT A COMPUTER. That means your emotions will enter into the picture at some point. You’ll start missing trades, second guessing on trades, panicking out of trades and generally screwing up. Computers don’t get emotional, they don’t get back aches, sore eyes, headaches. They don’t go through fits of depression, euphoric highs and bouts of boredom. YOU DO! The market always hurts you when you are weakest and trying to execute 20 or 30 trades per day, 5 days per week, will wear you down, fry your brain and leave you emotionally vulnerable. In short, you can’t trade that way because ... you’re human.

The objective is to target only those trades that offer the highest probability of success. This requires a thorough understanding of the relationships between the TREND ( pivot patterns ) and MOMENTUM ( readings on KP0118 ). Once again, our mission is not to 'predict' where the market 'may' move next, rather, we are reacting to the markets current movement. In essence, we are attempting to scalp' little pieces of profit out of an established, well defined trend. In order to do this successfully you must be PATIENT.

Your PATIENCE will always be rewarded.

Good traders are patient and selective, making only one or two trades per day. Gamblers are impatient, reckless, impulsive and tend to make 15 or 20 trades per day. Gamblers ALWAYS LOSE AT THIS TABLE. Your job, every day, is the same. Define the TREND, measure MOMENTUM and time your trade in the direction of the TREND. You repeat this procedure, day in and day out, in bull markets and in bear markets. You are battling your emotions on every trade. The market is like a living animal and it will deceive and intimidate you whenever possible.

As a trader, many times you will be doing the exact opposite of what your human instincts dictate. You'll be looking for a place to go short even though prices are moving higher, or, you'll be looking to buy when prices are declining. ALWAYS KEEP THIS THEME IN MIND; In a downtrend we want to get short at the HIGHEST PRICE possible. Therefore, we'll be looking to SELL THE COUNTER RALLIES. In an up trend we want to buy at the LOWEST PRICE possible. Therefore, we'll be looking to BUY THE DIPS. Obviously, in order to do this we need to be able to identify the TREND .. RIGHT?
HERE IS THE GOLDEN RULE ON TRENDS: An UP TREND remains an up trend until prices drop below the most recent pivot low ( breakpoint ). If you've forgotten what the breakpoint is, go back and review the earlier material. In other words, we may make a lower pivot high, but, until we have made a new lower pivot low ... it's still an up trend. A DOWNTREND remains a downtrend until prices exceed the most recent pivot high ( breakpoint ). We may make a higher low, but, until we've made a higher high ... it's still a downtrend. Review this paragraph very carefully
 

linkon7

Well-Known Member
#3
First we need a trend following tool. Timeframe preferred is 5 min.... to avoid noise....What the best indicator to follow trend....
 
Last edited:

linkon7

Well-Known Member
#5
this formula generates a buy when the wma(close,6) is greater than the wma ((open+close)/2, 7). Problem is it generates hell of a lot of signals.



basic formula here is :


pWMA1 = Param("WMA 1 period", 6, 1, 20, 1);
pWMA2 = Param("WMA 2 period", 7, 1, 20, 1);
fMA1 = WMA(C, pWMA1); // calculate MA 1
fMA2 = WMA( (Open + Close)/2, pWMA2); // original

Buy = fMA1 > fMA2;
sell = fMA2 > fMA1;

Plot(C, "", colorBlack, ParamStyle( "Price Style", styleBar, maskPrice ) );
Plot(fMA1, "\nMA1(" + NumToStr(pWMA1, 1.0) + ")", colorRed); // plot the MA lines
Plot(fMA2, "\nMA2(" + NumToStr(pWMA2, 1.0) + ")", colorRed, styleDashed); // plot the MA lines

PlotShapes(Buy * shapeUpArrow, colorGreen, 0, L, -5 );
PlotShapes(Sell * shapeDownArrow, colorRed, 0, H, -5 );
 

Rajadhiraj

Well-Known Member
#6
Hello Linkon

Nice Mindmap. Seems you too come from IT background :)

How many systems have you evaluated so far? What are the lessons learned from them?

That would be a nice place to start with for the strategy part, what say?

And btw coding should be least of your worries
 
#7
Hello Likon,

I Also Want to Develop Trading System Which Will Generate buy And Sell Signals Depending Upon The Trend And Once a Signal Is Generated Then Afl Should Suggest A Target And Trail Stoploss So That We Can Manage Our Money And Risk.
The Risk Reward Ratio Should Be 1:3 Means Reward Should Be Triple Of Risk. I Think We Can Create This System. If You Have Any Tutorial About How to Create Trading System Then Please Share It With US
 

linkon7

Well-Known Member
#8
Hello Linkon

Nice Mindmap. Seems you too come from IT background :)

How many systems have you evaluated so far? What are the lessons learned from them?

That would be a nice place to start with for the strategy part, what say?

And btw coding should be least of your worries
I have a computer hardware background... But i think having basic sense of how to code is essential in developing a system. Initially, the objective is to frame the conditions and then develop the afl to meet those conditions.
 

linkon7

Well-Known Member
#9
Lets work on the conditions:


Entry :
We wait for the current trend to break and take a position after the current trend is broken. Benefit of this kind of entry is that we have a smaller stop loss as, in case the trend-break turns out to be a false one, we can exit at the trend line....

confirmation:
We need a confirmation that the trend has broken and for that we use the cci (14) indicator. Again we look for a trend line break in the indicator.

2nd confirmation:
We use a trend line break in the RSI-21 indicator as the second confirmation.

Other confirmation :
Boilinger Band (9,2) should confirm the change in direction.

Stop loss:

We use the low/high of the last 3 bars as the stop loss.

Exit :

We trail the Stop loss till it is hit.



Here we have a simple daily chart of dow jones (as i dont have access to nifty charts from my office :))

1. We add the trendlines by joining the previous highs and the previous lows.
2. We add Boilinger band (9,2) as our alternate confirmation
3. We use CCI-14 indicator and draw the trendlines
4. We use RSI-21 indicator as the second confirmation and draw trendlines on that as well.



Now we wait for the trend lines to break in either direction
 

linkon7

Well-Known Member
#10


Finally price broke in the upside.
We wait for the break out bar to complete and on the next bar, we enter long.

Now the question is, where do we place the stop loss.

1. We can place the stoploss at the low of the last 3 bars. But it is pretty deep and incase the break out turns to be a false one, then we take a relatively bigger hit.
2. We can place it at the low of the break out bar. We are leaving more room for the noise here.
3. We can place it a few points below the trendline. Since the assumption is this is a breakout a close below the trendline means the breakout was false and we have no reason to hold on to the long. The logic here is, if the very reason we entered the trade is not valid...then exit.

Now, say the price did break out on the long side.... we immediately place the stoploss above our break-even, so that this trade cannot go into a loss anymore.

Exit:
We trail the price, by gradually increasing the stop loss as the low of the last three bars and continue to hold on to the position till the stop loss is hit....

Our target remains to capture 80% of the move.
 

Similar threads