How can I debug my PosSizer in Visual Studio 2008 / Fixed Ratio
Author: Compaqster
Creation Date: 1/8/2011 2:25 PM
profile picture

Compaqster

#1
I created money management method on the basis of an example, but i have a problem and I would like make debug of my method in Visual Studio 2008. How can I do it? I was reading this story http://www2.wealth-lab.com/WL5WIKI/Default.aspx?Page=kbAskGlitchDebug&NS=&AspxAutoDetectCookieSupport=1. but there is described the process of debugging strategies. My problem is that after connecting debugger to the Wealth-Lab the breakpoint in the code can not be activated.
P.S. Sorry for my bad english.
profile picture

Eugene

#2
PosSizers are debugged like any other library type. Could you describe step by step how you're doing it and becoming unable to activate breakpoints?

Off the top of my head: does the Wealth-Lab's main folder contain a Debug build?
profile picture

Compaqster

#3
All has earned.
I have forgotten it to make. =)


"Set the Output Path of the project, in the Build tab of the Project's Properties, to the Wealth-Lab installation directory. This will cause the resulting assemblies to be built into the Wealth-Lab folder, and this be visible to Wealth-Lab."
profile picture

Compaqster

#4
I know the question is not on the subject.
But maybe you could publish the source code of Fixed Ratio.
I would like to modify it to work with the shares because the current version works only correct with a futures.
profile picture

Eugene

#5
How would you modify the formula?
profile picture

Compaqster

#6
Fixed Ratio starts to work 1 contract.
If I'm working with shares a one share should earn delta.
I want to modify the code so that I could adjust the number of securities in one contract.
For example, if I trade futures, I put the size of a single contract 1, if I trade stocks, I put the size of a single contract 100.
profile picture

Eugene

#7
So you would increase the lot size e.g. from 1 to 100. But why wouldn't you simply reduce the Delta? From $10,000 per single contract to e.g. $100?
profile picture

Compaqster

#8
I tried.
I posed the delta 10 but turns out that I trade only 4-6 stocks per year
http://img263.imageshack.us/i/39905236.jpg
profile picture

Eugene

#9
I see. Here's a Fixed Ratio formula (out of several possible):
CODE:
Please log in to see this code.

Let's say the PosSizer is able to make the size start from an arbitrary number of shares e.g. 100. So what would be your proposed adjustment to the formula to account for that?
profile picture

Compaqster

#10
I used a different algorithm.
Here's my version.
?alculate the upper and lower boundary, if cash between them then trade the former number of contracts, if the cash goes beyond the boundaries recalculate the boundaries and change the number of contracts. Then multiply the number of contracts on the size of a single contract.

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

Eugene

#11
Nice work. Looks like you should have no trouble with your own Fixed Ratio PosSizer. ;)
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).