Get Starting Capital from Code
Author: burunduk
Creation Date: 10/30/2013 4:18 AM
profile picture

burunduk

#1
Hi guys. Is there an opportunity to get value of Starting Capital from a code of strategy.

I want to use SetShareSize(contracts) method in code where contracts = 10% from Starting Capital. Then I will be changing the percent of new capital to calculate new size for every position. So I need to know Starting Capital from the code of my strategy to have the initial contract size. Could you please help me to get it.
profile picture

Eugene

#2
Hi Pavel,

First, let me ask why not simply use Percent Equity? Or build a custom PosSizer if the built-in option doesn't cover some twist in your sizing logic?
profile picture

burunduk

#3
Hi,

Thanks for a quick response. The reason is I need to change Percent Equity for each Position due to the strategy logic. So the option of constant Percent Equity doesn't work. No doubt I can build a custom PosSizer but the calculation logic of Percent Equity is uniquely defined by the Strategy. So this PosSizer will be applicable only for one Strategy. That's why I don't want to build a common PosSizer and want to include it into the code of my Strategy.
profile picture

Eugene

#4
Then GetPositionSize from Community Components should do it:

QUOTE:
PctEquity;5000;100;100000;...


The Starting Capital figure in this sample is highlighted in bold.
profile picture

burunduk

#5
Hi Eugene,

Thanks a lot for your help. I looked into how GetPositionSize is built inside. It's very interesting.
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).