SP and MP Codes for Portfolio Simulation
Author: Jim0000076
Creation Date: 2/6/2013 10:06 AM
profile picture

Jim0000076

#1
Eugene,

I have been comparing results from two codes, one is written in Single Position (SP) and the other in Multiple Position (MP) format. Both codes have exactly the same entry and exit rules. Niether system pyramids. Both codes are run in simulation mode with the same risk for a portfolio but the results are significantly different with the SP format always producing a lower performance than the MP system. Do you know why this could be? Which code format should I be using for a portfolio simulation without pyramiding?

Thanks in advance.

Jim

profile picture

Jim0000076

#2
Eugene,

I think I may have had a bracket in the wrong place on the MP code. I need to re-check.
profile picture

Eugene

#3
Jim,

More information would definitely not hurt. Right now, I'm in the dark! :)
profile picture

Jim0000076

#4
Sorry Eugene,

I have been through my codes again in detail and I finally worked out what is happening. I am using the second MP code with the Possizer 'Pyramiding' with the Pyramiding setting set to 0 pyramids. But the Possizer is allocated the funds for pyramiding even though no pryamids trades are taken, the end result is that it does not take the initial position because it has allocated the funds to pyramid that it does not take. If I turn off the pyramid buy part of the script and still run the possisizer I get the same result as for the SP system.

Have you come accross this before? Could my pyramiding code be wrong? Is there a bug in the Pyramiding Possisizer?

Thanks in advance.

Jim
profile picture

Jim0000076

#5
Eugene,

Here is an example of my Pyramid buy script, just wondering if you could pass your eyes over it to see what I am doing wrong. It is a slighly cut down version of the one I am testing but it shows the logic. If you turn off the pyramid buy loop and run in pyramid possisizer you will see that it will take more trades than if this loop is turned on and the pyramid possisizer is set to 0 pyramids.

Thanks in advance

Jim

CODE:
Please log in to see this code.
profile picture

Eugene

#6
Jim,

On how to apply pyramiding using a working design pattern, I think you might find these resources helpful:

* KB article: WealthScript Techniques | Pyramiding (Adding to position)
* Strategies: [link=http://www.wealth-lab.com/Strategy/Details/137]ActiveTrader 2010-04 | Volatility scale in system] and R3 Strategy (Aggressive version) (Rev.A)

Also, make sure you've reviewed these threads carefully:

* Skipped trades when using R3 Strategy(Aggressive version) with Pyramiding PosSizer
* RSI scale out system (Rev.C) in simulation mode
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).