In strategies properties window, there is a trade size field (which is used if signal does not specify the number of contracts).
Is there a keyword in PL that can be used to get this 'trade size' value from strategies properties window in the code. Thanks.
-Hilbert
quick PL question [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: quick PL question
Hello Hilbert,
There is no reserved word to get this value.
You can specify the trade size in contracts or shares in the code. If it is not specified in the code then Trade Size value from Strategy Properties window is used.
There is no reserved word to get this value.
You can specify the trade size in contracts or shares in the code. If it is not specified in the code then Trade Size value from Strategy Properties window is used.
Re: quick PL question
Thanks Henry! I can get commissions used in the strategy properties window in the code using keyword "commission". So, I thought it might be possible to get tradesize as well. Can you suggest a way around? Or, is there a way to tell the code whether the strategy has been applied on a stock, future or fx?
Motivation for this request is following:
I have written a money management (MM) function which I call from my different strategies to get desired position size. MM function has different cases viz:
-> using a constant "k" number of contracts/shares in all trades
-> fixed fractional
-> kelly etc.
I want to use different values of "k" depending on the instrument that has been plotted. So, for futures k=1, for stocks k = 100 and for FX k = 10000.
So, either the code should know the instrument of the chart. Alternatively, I should be able to pass to the code value of 'trade size' from strategy properties window. Thanks for suggestion.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: quick PL question [SOLVED]
Category- Returns a numerical value, indicating the category (financial instrument type) of the symbol that study is applied to.Or, is there a way to tell the code whether the strategy has been applied on a stock, future or fx?
Re: quick PL question
Henry, it worked perfectly. Thanks.Category- Returns a numerical value, indicating the category (financial instrument type) of the symbol that study is applied to.Or, is there a way to tell the code whether the strategy has been applied on a stock, future or fx?