pmms_strategy_get_entry_contracts(idx) always return -1  [SOLVED]

Questions about MultiCharts and user contributed studies.
winnie

pmms_strategy_get_entry_contracts(idx) always return -1  [SOLVED]

Postby winnie » 16 Jun 2016

Hi,

I use pmms_strategy_get_entry_contracts(idx) in MultiCharts9.1, no matter what the contract is, it always return -1.

Please have a check on this keyword.

Thank you~

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

Re: pmms_strategy_get_entry_contracts(idx) always return -1

Postby Henry MultiСharts » 16 Jun 2016

Hello winnie,

pmms_strategy_get_entry_contracts returns the number of contracts only if the value was overridden by pmms_strategy_set_entry_contracts on the current calculation. So the value is Set first, then it can be Get.
You can use pmms_strategy_set_entry_contracts(pmm_get_my_index, Contracts) in the trading signal to define the number of contracts for this strategy to buy.
Then you can use pmms_strategy_get_entry_contracts in PMMS to get the value, and you can also override it with pmms_strategy_set_entry_contracts from PMMS.


Return to “MultiCharts”