PDA

View Full Version : Pyramid trades


Dirk DC
10th December 2003, 09:11 AM
David,

You probably know 100 times more about pyramiding than I do and I admire you for adding this option to TS. It is a subject that has very little information available to the public and the "proper" techniques applied to portfolios are carefully kept as secrets by most professionals (the 90% losers in the markets all know why that is...).

I would like to highlight a few things on this subject. Maybe there is something useful in it for one of the next versions of TS:

1. Most of the risk-based volatility trading models include a pyramid strategy linked to market volatility. In other words the position needs to move x*ATR() (or x*STDEV) before the next level can be added. The trailing stop is linked to this and ensures the position risk exposure does not get out of hand. The way pyramid positions are currently programmed in TS, it is difficult or impossible to keep this risk exposure under control as positions are added after a certain amount of paper-profit is made, regardless of what the market volatility.

2. A correct pyramid position should look...indeed like a pyramid. This means that every next level should carry less positions than the previous one. The way this is done depends on the trading system and risk tolerance level of the trader. A rule of thumb here is that the total positions are about equal to twice the "level 0" number (i.e. 8-4-2-1-...-1). The number of positions added reduces as the price gets more stretched during a trend. Risk exposure can be better controlled like this.
The way pyramid positions are currently programmed in TradeSim, there is no such risk control in my opinion as positions are added after a certain amount of profit ($ or %) is made. There is also no control of the number of positions added to the individual levels after "level 0".

Suggestions:
1. The pyramid position algorithm should carry an option to add positions after a certain amount of movement expressed in some volatility measurement (i.e. x*ATR() or/and x*STDEV)
2. Control of number of trades per level should be programmed in. This can be expressed as a % of the previous level. This % can be 100% - as it is now by default - or less depending on the level of risk tolerance (i.e. 8-4-2-1...1 would mean 50% level reduction). Number of positions calculated would have to be rounded down to the next integer number.
3. The algorithm should carry an option to add a "trigger" level for the pyramiding to start off (MFE analysis is a good technique to determine this price movement level - in USD-cts)

I hope it all makes a bit of sense. In my opinion it would make the pyramid module in TS more flexible and more complete.

PS If I have interpreted the current TS programming on this subject wrongly, please let me know.

cheers,
Dirk DC

David Samborsky
10th December 2003, 12:49 PM
1. Most of the risk-based volatility trading models include a pyramid strategy linked to market volatility. In other words the position needs to move x*ATR() (or x*STDEV) before the next level can be added. The trailing stop is linked to this and ensures the position risk exposure does not get out of hand. The way pyramid positions are currently programmed in TS, it is difficult or impossible to keep this risk exposure under control as positions are added after a certain amount of paper-profit is made, regardless of what the market volatility.


This is not strictly true. There is an alternative way of pyramidding trades based on your own re-entry criterion, which maybe based on volatility etc. The following excerpt from AN-3 describes the three different trigger mechanisms.

The TRIGGER_TYPE parameter determines the criteria for which trades can be pyramid on to existing trades.


Trigger When the Trigger Type parameter is set to ‘Trigger’ then additional trades are pyramid to existing trades based on the EntryTrigger array passed to the RecordTrades function.

DollarProfit When the Trigger Type parameter is set to ‘DollarProfit’ then additional trades are pyramid to existing trades based on whether or not the currently highest-level trade exceeds a certain dollar profit threshold with respect to its entry point. This allows a trade pyramid to be built up by taking advantage of a rising and profitable trend. Note that the profit parameter is specified in dollars and not cents.

PercentProfit When the Trigger Type parameter is set to ‘PercentProfit’ then additional trades are pyramid to existing trades based on whether or not the currently highest-level trade exceeds a certain percent profit threshold with respect to its entry point. This allows a trade pyramid to be built up by taking advantage of a rising and profitable trend. Note that the Percent Profit parameter is expressed as a percentile.


As an example the following simplified example sets up a trade pyramid based on a trend on the long side as well as Volatility exceeding a certain threshold etc.


ExtFml(“TradeSim.EnableTradePyramiding”,Trigge r, 0,20);
EntryTrigger:=LongTrend AND Volatility>3;

Dirk DC
11th December 2003, 12:17 AM
David,

Entry rules and pyramid rules are best kept separate in my opinion. An extra "trigger type" based on price movement expressed as some measure of volatility would do the trick here. The ability of reducing the number of positions added per level is essential to keep position/portfolio risk exposure under control.

Pyramiding can be extremely complex and I fully understand that it would be a hell of a job trying to cover all options. Nevertheless it remains food for thought for one of the future TS versions.

:wink:
Dirk DC

David Samborsky
11th December 2003, 02:55 AM
Yes I was thinking that myself when I was writing the reply.

The problem here is that any external formula can only except a maximum of 9 parameters so it gets a bit tricky if you want any more. I have used all of the nine parameters so it would be iconvenient to include another one. Another way around it would be to encode the EntryTrigger. ie value of 1 is an entry and a value of 2 a pyramid entry etc.

Dirk DC
11th December 2003, 09:24 AM
David,

...or drop either the % or the $ trigger out of the algorithm to make some "space". After all they both are a measure of a certain amount of profit made prior to entering the next pyramid level. One of those would maybe suffice here.
This maybe also creates the possibility to programme control over the number of positions per level expressed as a % of the previous level (100% as default). This % would be entered as a variable in the algorithm and would be applied to every next level of the pyramid.

Keep up the good work.

:wink:
Dirk DC

David Samborsky
11th December 2003, 01:57 PM
It's the RecordTrades function I was talking about. All of the nine parameters are already in use.

Dirk DC
11th December 2003, 02:30 PM
Maybe the EntryTrigger creative programming solution you suggested would be the way out then.
I do hope this issue can be kept on the list for further investigation.

:wink:
Dirk

Roadster
10th June 2004, 11:28 AM
Does this imply that TradeSim cannot incorporate pyramiding based on a variable other than a set dollar profit / move. Extending this, does this mean that the Turtle system is unable to be tested by TradeSim. I am looking at TradeSim to complement Metastock (poor system tester) and would go for the top product (Monte Carlo analysis v useful) but would have to consider VeriTrader as this allows different pyramiding - but at twice the price!

Thanks for any feedback

David Samborsky
11th June 2004, 02:25 AM
If you use Trigger as the TRIGGER_TYPE then you can define your own re-entry triggers.

I talked at about the pros and cons of VeriTrader at http://www.compuvision.com.au/phpBB2/viewtopic.php?t=284

Also if you purchase a package such as VeriTrader you may not being able to formulate and test your own trading strategies.

APensw
31st August 2004, 10:53 AM
Dirk / David,

As a comparatively new user, please forgive any gaffs in the following....

I've read the postings, here and elsewhere, on pyramiding with interest - I agree with the need to separate the initial entry and subsequent pyramiding triggers and am still a little confused as to whether / how this can be done.

I posted a related question on 'time-based pyramiding' on July 19th (but got no replies) :- "I'd like to be able to increase my position after a certain amount of time in the trade has passed....so after x days (eg the average days in the trade for a losing trade), .... I'd like to add to the position after the x days (or some function of it) has elapsed. ". What this amounts to is a different 'entry trigger' for a pyramid trade than for a normal entry.

Would your suggestion (David - in one of the earlier replies on this thread) of encoding the entry trigger enable a pyramid trade to be triggered for example 10 days after the original entry (assuming the trade is still live)? If this has potential, could you outline briefly what the code would look like. I'm assuming the entry trigger would have 2 outcomes (eg 1=normal entry trigger; 2=pyramid entry trigger), but how would these be referenced in the record_trades function?

If it is not possible to create separate initial entry and pyramid entry triggers, then I think it would be a great addition to what is already an excellent tool.

Many thanks,

Dirk DC
3rd September 2004, 10:31 PM
Hi APensw,

I hope you've done your homework properly on this subject because the logic in the pyramid technique you explained escapes me completely... (it could be me of course) :?:

David Samborsky
4th September 2004, 01:39 AM
It's explained alot better in document AN-3 than what I can do here :wink:


I posted a related question on 'time-based pyramiding' on July 19th (but got no replies) :- "I'd like to be able to increase my position after a certain amount of time in the trade has passed....so after x days (eg the average days in the trade for a losing trade), .... I'd like to add to the position after the x days (or some function of it) has elapsed. ". What this amounts to is a different 'entry trigger' for a pyramid trade than for a normal entry.


You should really only add to a position when things are favourable. ie trend moving in a favourable direction. Otherwise it's hard to code a timed entry using the MS language. Unfortunately you are making things difficult for yourself here. :(

APensw
6th September 2004, 02:36 PM
Dirk/David,

I was hoping that the ability to code a separate pyramid entry would enable me to actually do my homework.....

As for the logic, please tell me if I'm being naive here, but on looking at one of the systems I was testing I noticed the 'time in the trade' for successful trades was on average much longer than for unsuccessful ones. Therefore the set of trades that survived the initial fall-out had a greater probability of going on on bigger and better things than the initial full set of [level 0] trades generated by the entry trigger even if they were not displaying any evidence of good trending etc at that point. Thus it seemed reasonable to check out the impact of pyramiding these 'surviving trades' after the initial fall-out. That was the hypothesis, and the reason for asking about time as an entry criteria, but please put me out of my misery if my logic is way off the mark.....!

At the end of the day, it comes back to the separation of pyramiding entry criteria from initial entry criteria and I'd really welcome any moves to add that functionality. I also agree that tapering the position size over successive pyramid trades is a very sensible and useful feature.

Cheers,

Dirk DC
30th October 2004, 08:54 AM
Hi,

Sorry for this late reaction.
Although I don't have the full results of your research on this subject, in my opinion time-based pyramiding as explained in your note would have at least two important issues to be resolved:

1. Adding to a non-trending position requires a set of "steel balls"
2. Adding to a non-trending position will kick the exposure level through the ceiling (even when the second level is reduced by x-%). The initial position size and the initial stop as governed by your position size algorithm (PSA), reflect the maximum initial risk for the trade. A purely time-based addition to the position without adjusting the stop would increase this risk beyond the maximum. Adjusting the stop to compensate for risk exposure changes your trading system and thus your (positive) expectation inherent to the system you're trading. As a general rule excessive risk should only be adjusted by reducing the overall position size, not by adjusting the stop. Fiddling the PSA to reduce the initial position size to be able to pyramid the second (and subsequent levels) and still stay within the max. risk defeats the purpose of the exercise.

There may be an "out of the box" way around point #2.
Point #1...you have 'em or you don't.

PS Indeed pyramid rules should be different from initial entry rules. David agrees with this as well. From his replies there seem to be some software-technical restrictions on what can be done to cater for this.

cheers,
Dirk

Dirk DC
30th October 2004, 08:55 AM
Hi,

Sorry for this late reaction.
Although I don't have the full results of your research on this subject, in my opinion time-based pyramiding as explained in your note would have at least two important issues to be resolved:

1. Adding to a non-trending position requires a set of "steel balls"
2. Adding to a non-trending position will kick the exposure level through the ceiling (even when the second level is reduced by x-%). The initial position size and the initial stop as governed by your position size algorithm (PSA), reflect the maximum initial risk for the trade. A purely time-based addition to the position without adjusting the stop would increase this risk beyond the maximum. Adjusting the stop to compensate for risk exposure changes your trading system and thus your (positive) expectation inherent to the system you're trading. As a general rule excessive risk should only be adjusted by reducing the overall position size, not by adjusting the stop. Fiddling the PSA to reduce the initial position size to be able to pyramid the second (and subsequent levels) and still stay within the max. risk defeats the purpose of the exercise.

There may be an "out of the box" way around point #2.
Point #1...you have 'em or you don't.

PS Indeed pyramid rules should be different from initial entry rules. David agrees with this as well. From his replies there seem to be some software-technical restrictions on what can be done to cater for this.

cheers,
Dirk

Dirk DC
30th October 2004, 08:56 AM
Hi,

Sorry for this late reaction.
Although I don't have the full results of your research on this subject, in my opinion time-based pyramiding as explained in your note would have at least two important issues to be resolved:

1. Adding to a non-trending position requires a set of "steel balls"
2. Adding to a non-trending position will kick the exposure level through the ceiling (even when the second level is reduced by x-%). The initial position size and the initial stop as governed by your position size algorithm (PSA), reflect the maximum initial risk for the trade. A purely time-based addition to the position without adjusting the stop would increase this risk beyond the maximum. Adjusting the stop to compensate for risk exposure changes your trading system and thus your (positive) expectation inherent to the system you're trading. As a general rule excessive risk should only be adjusted by reducing the overall position size, not by adjusting the stop. Fiddling the PSA to reduce the initial position size to be able to pyramid the second (and subsequent levels) and still stay within the max. risk defeats the purpose of the exercise.

There may be an "out of the box" way around point #2.
Point #1...you have 'em or you don't.

PS Indeed pyramid rules should be different from initial entry rules. David agrees with this as well. From his replies there seem to be some software-technical restrictions on what can be done to cater for this.

cheers,
Dirk

David Samborsky
31st October 2004, 06:00 AM
Some new features will be added to the pyramid strategies that allow more much more flexiblity.

Expanding on the trigger reentry types will add four more re-entry modes

These are:-

DollarProfitAndTrigger Re-enters a trade when the dollar profit threshold is exceeded and the EntryTrigger is asserted at the same time.

DollarProfitOrTrigger Re-enters a trade when the dollar profit threshold is exceeded or the EntryTrigger is asserted at the same time.

PercentProfitAndTrigger Re-enters a trade when the percent profit threshold is exceeded and the EntryTrigger is asserted at the same time.

PercentProfitOrTrigger Re-enters a trade when the percent profit threshold is exceeded or the EntryTrigger is asserted at the same time.

In addition to this you can now specify the way the profit threshold is measured. Currently it is measured using the ExitPrice parameter and comparing this with the entry price then re-entering the trade using the Entry Price. However there maybe a considerable amount of slippage between the entry and exit prices and any profit gains maybe eaten up by slippage.

Two more profit threshold options will be added:-

Determine Profit Threshold using the EntryPrice and reenter using the EntryPrice. In this case you would typically use the Open price as the Entry Price.

Determine Profit Threshold using the DailyRange. ie when the profit threshold is detected then reenter the trade at exactly the profit threshold price. This avoids any slippage.