# Mechanical System and Pyramiding



## Chorlton (1 August 2007)

Hello All,

From what I've read, Pyramiding seems to be a paramount part in developing a profitable system.

However, with regard to a mechanical system, how would one add to open positions?  

Would you wait for another identical buy signal to be generated by the system while still in the current trade?  If this is the case, then what would happen when a sell signal is generated? Would you close only the first position, or both of them, or would this decision be defined by backtesting?

... or am I totally wrong here??

Any Help much appreciated.....

Chorlton


----------



## rub92me (3 August 2007)

If you had a mechanical system it could generate another buy signal for the same sytock after your intial purchase (especially if one of your buy triggers is based around making highest highs in a certain period for instance). Based on your 'available to trade' it could therefore add to your original position.
On the sell side, it would depend how the sell signal is triggered. E.g a trailing stop around EMA could stop you first out of your latest (higher) purchase. A percentage gain stop could stop you first out your first purchase. 
From a systems perspective it doesn't matter that you made 2 purchases of the same stock.


----------



## Chorlton (3 August 2007)

Thanks Rub.......  Thats what I was thinking of doing with my Entry but looking at other ideas as well..........


----------



## theasxgorilla (3 August 2007)

Hi Chorlton,

I'm by no means an expert on this but I've made a few mistakes with pyramiding that centred around pyramiding too late and too early.

The best risk/reward entry point for any trade is where you can have your stop as tight as possible.  You should find out sooner if your are wrong, and with less of a loss than a wider stop would have caused.  The problem is that entry around these areas exposes you to the real risk of false breakouts/trend-reversals.  Entering where the R/R makes sense usually means you will open a position before it is apparent whether the bulls or bears have won.

The best time to tell who has won the bull/bear battle (so to speak) is when the battle is almost over.  This is when you should pyramid.  You should add _smaller amounts_ when you receive confirmation to your satisfaction that a trend is underway...and that you have backed the winning side.  This could be a new all-time-high, for example, if it is near enough to your initial entry.  If price forms a new all-time-high there are technically no share holders at that time with a losing position...usually a confirmation that the bulls are winning.

Something to consider is that if you are trading a small account size and brokerage is a fair proportion of your trading expenses then pyramiding will increase that cost by a factor of roughly 1/3rd, so where possible I test with brokerage costs included.

ASX.G


----------



## Synergy (3 August 2007)

I have thought about pyramiding a bit but I have trouble understanding how it can be a viable strategy.

2 reasons:

1. Entry decisions need to be made on face value, and not be swayed by whether or not you already hold a stock. If you're topping up would you still make the purchase if you didn't already hold the stock? Why not just pick a stock that hasn't already started to go up?

2. If the system is picking a stock you already hold isn't the risk then increased by buying more of that stock?

I'd like to know more about it because obviously people use is successfully.


----------



## Sir Burr (3 August 2007)

Synergy said:


> I have thought about pyramiding a bit but I have trouble understanding how it can be a viable strategy.




Agree 110% with both points.

Why bother complicating a trade (risk) by adding to it? Why bother jumping in again, further up a trend? Why not take a trade on another stock which may or may not be the start of something big?


----------



## theasxgorilla (3 August 2007)

Sir Burr said:


> Agree 110% with both points.
> 
> Why bother complicating a trade (risk) by adding to it? Why bother jumping in again, further up a trend? Why not take a trade on another stock which may or may not be the start of something big?




Really good questions...what does your testing suggest SB?


----------



## Sir Burr (3 August 2007)

theasxgorilla said:


> Really good questions...what does your testing suggest SB?




Suggests it's not worth doing as results are lower.

That sentence is the single/simple result of extensive personal testing. Many may find different results though!


----------



## Chorlton (4 August 2007)

Synergy said:


> If the system is picking a stock you already hold isn't the risk then increased by buying more of that stock?.




In the case of a mechanical system, surely by not taking every trade identified by the system in question, then you are in fact adding some discretionary element to it which could impact on its expected performance?

I appreciate that in real-life taking every trade is probably not possible due to ones capital available but unless you can backtest this aspect thoroughly and understand its implications then I would be concerned about trading it in real-life.

Whats other posters views on this?

Chorlton


----------



## theasxgorilla (4 August 2007)

Chorlton said:


> I appreciate that in real-life taking every trade is probably not possible due to ones capital available but unless you can backtest this aspect thoroughly and understand its implications then I would be concerned about trading it in real-life.




And what happens if you get two signals on the one day, one a buy and another a scale-in/pyramid, but you only have enough capital to take one...which do you favour?

Really good points and questions.


----------



## Chorlton (4 August 2007)

theasxgorilla said:


> And what happens if you get two signals on the one day, one a buy and another a scale-in/pyramid, but you only have enough capital to take one...which do you favour?
> 
> Really good points and questions.




Gorilla,

I've recently purchased TradeSim within the last few days so currently only reading the very extensive manual!!!

However, TradeSim should hopefully overcome this issue for me as it allows the user to test all permutations and provide some statistical feedback on this point.

Using your example above, my current thoughts as to how I would deal with this would be if funds did not allow me to take both positions, then (assuming that my backtesting results showed a positive expectancy) then I would probably use some form of discretionary filter to trade one of them... something like "Bang for Buck" so as to offer me the best return for my money......

Chorlton


----------



## motorway (4 August 2007)

Think of it in terms of opportunity cost

If you initially only allocate 1/3 to a entry

Then the other  2/3 might be added with follow on signals 
or they might be allocated to other positions entirely

Which could turn out better

You will end up with 3/3 committed to only the strongest moves 
( in time and magnitude ) 

If the initial 1/3 stops out 
That is better Than 3/3 

And while that position goes no where other positions are being
 taken because there is capital available to take them..

You can not know the future
But you can follow along ( very closely )

allocating capital in tranches

With only initial 1/3 committed
When mkts move against you

downside is minimized as well

full allocation has an element of depth/foundation

 diversification on another dimension



motorway


----------



## tech/a (4 August 2007)

Wow missed this thread so much here to comment on.

Below are *MY* findings on the topic.

*ASX* agree mostly with post and observations re your experience with pyramiding. I have done a great deal of work on this and will present my findings through responses to various posts here.

Starting with *Synergy*.







Synergy said:


> I have thought about pyramiding a bit but I have trouble understanding how it can be a viable strategy.
> 
> 2 reasons:
> 
> ...





What I can tell you is results are better if you can *"Latch"* the FIRST occurence of your buy trigger in your purchase.I do this with a hybrid version of T/T.In other words the exact opposite.The system doest trigger another buy even if triggered until the initial buy and sell/exit are played out in that stock.Roy Larsen has published a "Latch" for metastock I dont know if anyone has converted it to Amibroker.---Its on the Formula thread for techtrader---metastock.



> Why bother complicating a trade (risk) by adding to it? Why bother jumping in again, further up a trend? Why not take a trade on another stock which may or may not be the start of something big?




This is very dependant on *timeframe.*Think in terms of Risk reward rather than loss at a stop point.If you have an opportunity (Which you do with EVERY trade) to have multiple R/R then adding to it will double and treble that opportunity while leaving the Risk the same. Remember 3 trades in 1 stock or 3 trades in 3 stocks---same risk.

If I get a 20x R/R on a stock and I have 3 times as much on it as other stocks then I'm well and truely in front.*Ive leveraged my position.*



> In the case of a mechanical system, surely by not taking every trade identified by the system in question, then you are in fact adding some discretionary element to it which could impact on its expected performance?




*Chorlton*
A common *MISCONCEPTION.*
This is *WHY* you have purchased the Enterprise edition of Tradesim.
You probably didnt know why---

Your statement is the chagrin of every single Discretionary trader---which trade is going to bring home the bacon?

When you develope your system you WONT CARE as youll know that EVERY trade you take regardless of how many you miss due to lack of capital or being a sleep/lazy/in efficient---wont make a great deal of difference to your results.

How will you be so sure?
Montecarlo Analysis.

Tradesim will test your system over 20000 or more portfolios,each taking entries which are different from the base test.All will perform differently,some more than others.
Your left with a set of number which are a deviation from the base mean return of the system tested.The best and worse you can expect.These are the Parameters you monitor in times like these---where it is possible your system maybe experiencing conditions *NOT SEEN *in your test periods.
Here is a Montecarlo report of one of my methods.
You can see the extremes.

*Motorway*
What you say is correct however my findings are that in a WINNING method it averages itself out.Win some lose some.


----------



## Sir Burr (4 August 2007)

theasxgorilla said:


> And what happens if you get two signals on the one day, one a buy and another a scale-in/pyramid, but you only have enough capital to take one...which do you favour?
> 
> Really good points and questions.




Positionscore covers that in Amibroker:

eg: PositionScore = 50 - RSI();

The score (PositionScore) for all securities is calculated first. Then all scores are sorted according to absolute value of PositionScore. Then top N are choosen to be traded. N depends on available funds and "max. open positions" setting. Backtester successively enters the trades starting from highest ranked security until the number of positions open reaches "max. open positions" or there are no more funds available. The score has the following meaning:

- higher positive score means better candidate for entering long trade 
- lower negative score means better candidate for entering short trade


----------



## Sir Burr (4 August 2007)

tech/a said:


> What I can tell you is results are better if you can *"Latch"* the FIRST occurence of your buy trigger in your purchase.




Yes, same.



> Roy Larsen has published a "Latch" for metastock I dont know if anyone has converted it to Amibroker.---Its on the Formula thread for techtrader---metastock.




There is a function Exrem in Amibroker that does that. Much slicker than the MS coding to do that! :kiffer:

SB


----------



## Sir Burr (4 August 2007)

Chorlton said:


> use some form of discretionary filter to trade one of them... something like "Bang for Buck" so as to offer me the best return for my money




discretionary?

In Amibroker: Positionscore = ATR(200)/C*100;
In Tradesim: ExtFml( "TradeSim.SetVariableTradeRank",ATR(200)/C*100);

SB


----------



## Chorlton (4 August 2007)

tech/a said:


> This is *WHY* you have purchased the Enterprise edition of Tradesim.
> You probably didnt know why---




To be fair, this one the reason I purchased it and I did make reference to Tradesim in a post further down this thread.

The question I was asking was from a generic point of view where such software was not available. I was interested in how others would deal with this issue.

But as always, thanks for the comments.........

Chorlton

PS: On a seperate note, I'd just like to take this opportunity to say thanks for everyone who has offered feedback to my questions over the last few months, on this and other threads....

I have probably learnt more about what is really important in trading than at anytime up to this point.

Cheers to all..............


----------



## Chorlton (4 August 2007)

Sir Burr said:


> discretionary?
> 
> In Amibroker: Positionscore = ATR(200)/C*100;
> In Tradesim: ExtFml( "TradeSim.SetVariableTradeRank",ATR(200)/C*100);
> ...





Point Taken SB........

By discretionary, I was actually referring to something not already coded into my mechanical system. It was late when I typed my comments so could have chosen a better word other than discretionary.

... and Thanks for the Tradesim code


----------



## tech/a (4 August 2007)

> discretionary?




I use 2 eyeball chart filters myself. (discretionary).
Without worrying to much wether they work or not.Purely because I know from the M/C analysis that whatever I trade will fall within the minimum and maximum parameters of test results PROVIDED market action doesnt trade outside the boundaries of past history on which the system was designed.

My results have been toward the upper end of the extremes when it comes to actual traded results.

The filters are.
(1) must be in a clear up trend or clearly emerging into a new trend after clearly breaking an old.
(2) must not be trapped ina range over many years unless the buy signal is outside of that range.


----------



## Chorlton (4 August 2007)

tech/a said:


> What I can tell you is results are better if you can *"Latch"* the FIRST occurence of your buy trigger in your purchase.I do this with a hybrid version of T/T.In other words the exact opposite.The system doest trigger another buy even if triggered until the initial buy and sell/exit are played out in that stock.




Tech/a,

As an obvious newbie to system development, can I ask why adding a latch would make such a significant improvement?  Surely, as already stated there is, initially, no difference between taking a trade in a new stock or another trade in an exisiting one? 

So what piece of the jigsaw I'm I missing here??

Sorry for my misunderstanding here.......


----------



## CFD (4 August 2007)

tech/a said:


> ~~
> (2) must not be trapped in a range over many years unless the buy signal is outside of that range.




Are you against trading within a range? A problem with blue sky trading (although it's done very well of late) is that you do not know when you are nearing resistance and the support line has been left too far behind to know if it would hold.


----------



## tech/a (4 August 2007)

Chorlton said:


> Tech/a,
> 
> As an obvious newbie to system development, can I ask why adding a latch would make such a significant improvement?  Surely, as already stated there is, initially, no difference between taking a trade in a new stock or another trade in an exisiting one?
> 
> ...




Latching returns the FIRST occurence of the conditions of the method/system.
In the systems I trade which are generally triggered by higher highs/ breakouts more so than pull backs,the first occurence if the trade ends up a winner the length of trend will be greatest from the initial trigger.


----------



## tech/a (4 August 2007)

CFD said:


> Are you against trading within a range? A problem with blue sky trading (although it's done very well of late) is that you do not know when you are nearing resistance and the support line has been left too far behind to know if it would hold.




No not at all.
Can be highly profitable.
Works very well with futures.

This form of trading is more about frequency of winning trades than R/R of a longer term trend folowing method which relys more on R/R than Win ratio.


----------



## nizar (4 August 2007)

Wow, great thread guys.
Lots of good info here.

Iv just finished reading Way of the Turtle as well. Some good info there about systems testing and design.



> In the case of a mechanical system, surely by not taking every trade identified by the system in question, then you are in fact adding some discretionary element to it which could impact on its expected performance?




Tech's response to this is almost a carbon copy of what i tell my mates about why i just spent $1520 on tradesim enterprise.

And on another note -- I wander how many of the 95-97% of losing traders have tradesim enterprise?  Its a very powerful tool. Serious tools for serious traders.


----------



## tech/a (4 August 2007)

nizar said:


> Wow, great thread guys.
> Lots of good info here.
> 
> Iv just finished reading Way of the Turtle as well. Some good info there about systems testing and design.
> ...





Software may not = Success.
Like most things only as good as the driver!


----------



## nizar (4 August 2007)

tech/a said:


> Software may not = Success.
> Like most things only as good as the driver!




LOL true but its a bl00dy good start!


----------



## Chorlton (4 August 2007)

nizar said:


> LOL true but its a bl00dy good start!




I would second that........ In my opinion it is a tool which should help us level the "trading" playing field.....


----------



## Sir Burr (4 August 2007)

Testing Trade Pyramid Strategies using TradeSim


----------



## nizar (4 August 2007)

To those that do pyramid, when it comes to either pyramiding a position, or opening a new position, which one do you prefer?

Ie. if 2 entries are triggered on a given day, one a pyramid, and the other, another code, which one do you go for?

Also -- this will have implication for portfolio limits which I have started another thread for.


----------



## tech/a (5 August 2007)

Depends (for me) how mature a trend is and how long I have been holding the first purchase.If not long I would probably choose the open position if it was trading strongly in my favor.

If not or a more mature trade then I would look for the one (Eyeball) which I feel had best "Bang for Buck"---likely to bounce into profit.

Again go back to my comments on Montecarlo testing--


----------



## CFD (5 August 2007)

I prefer to allow money management to have a great influence in decisions.
ie using a 2% risk per trade, if the R/R is still showing a 2% risk when a second buy(sell) signal comes up on the same trade then let it pass. (You can not say a 4% risk on the same stock has not increased the risk). If the R/R has reduced to 0 or gone positive when a second buy(sell) signal comes up then take it. If the R/R is showing a !% risk, the only enter the second trade with an extra 1% risk.


----------



## tech/a (5 August 2007)

> You can not say a 4% risk on the same stock has not increased the risk




Err well yes I can.
If I risk 2% on each trade then 2 trades x 2% = 4% I'm no worse off than taking another trade.

There are a zillion ways to handle risk allocation on a pyramid trade to ensure risk is not increased.
The whole idea is to maximise R/R and minimising initial risk goes a long way in maximising return to risk.


----------



## CFD (5 August 2007)

You have concentrated your risk, which increases it. Which is not to say at times the risk does not eventuate and you have a better R/R as a result.


----------



## tech/a (5 August 2007)

> zillion ways to handle risk




If I have a 2% stop on the trade taken as a pyramid and leave the stop on the original trade.
Then I havent concentrated risk.


----------

