quick PL question  [SOLVED]

Questions about MultiCharts and user contributed studies.
hilbert
Posts: 224
Joined: 17 Aug 2011
Has thanked: 76 times
Been thanked: 64 times

quick PL question

Postby hilbert » 20 Feb 2013

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

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: quick PL question

Postby Henry MultiСharts » 20 Feb 2013

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.

hilbert
Posts: 224
Joined: 17 Aug 2011
Has thanked: 76 times
Been thanked: 64 times

Re: quick PL question

Postby hilbert » 20 Feb 2013

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.
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.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: quick PL question  [SOLVED]

Postby Henry MultiСharts » 21 Feb 2013

Or, is there a way to tell the code whether the strategy has been applied on a stock, future or fx?
Category- Returns a numerical value, indicating the category (financial instrument type) of the symbol that study is applied to.

hilbert
Posts: 224
Joined: 17 Aug 2011
Has thanked: 76 times
Been thanked: 64 times

Re: quick PL question

Postby hilbert » 22 Feb 2013

Or, is there a way to tell the code whether the strategy has been applied on a stock, future or fx?
Category- Returns a numerical value, indicating the category (financial instrument type) of the symbol that study is applied to.
Henry, it worked perfectly. Thanks.


Return to “MultiCharts”