[Portfolio] Link b/ "Signal" and "Money Management Signal"

Questions about MultiCharts and user contributed studies.
bluefightingcat
Posts: 38
Joined: 31 Oct 2015
Has thanked: 1 time
Been thanked: 2 times

[Portfolio] Link b/ "Signal" and "Money Management Signal"

Postby bluefightingcat » 20 Jan 2016

Unfortunately the documentation on the money management signals is quite limited. I am having a hard time figuring out the link between a Strategy's normal "signal" code and the "money management signals" code. How do they talk to each other? For example in my signal code I have the following:

Code: Select all

pmm_set_my_named_num( "BuySignal", rsivalue ) ;
This code comes after:

Code: Select all

Buy next bar open ;
If I have understood correctly if a stock (I trade stocks) fulfills my entry criteria and I want to buy it, then instead of just buying it, a signal is sent to the "money management signal" code. So now in this case the rsivalue of the stock that produced the signal is stored in the "buysignal" variable.

- How does the variable know which stock is in question. My strategy might produce several entry signals from several different stocks.

In my "money management signal" code I have this:

Code: Select all

for idx = 0 to portfolioStrategies - 1
begin
//increment the counter when a signal wants to enter
if pmms_get_strategy_named_num( idx, "BuySignal" ) > -1 then
buy_signals += 1 ;

Value_Idx[1, idx + 1] = pmms_get_strategy_named_num( idx, "BuySignal" ) ;
Value_Idx[2, idx + 1] = idx ;
end ;
So this code will loop through all my stocks and check whether it has a value in the BuySignal variable and then extra the rsivalue that was defined in the "entry signal" code.

- What does the += symbol do? What does a -= symbol do?
- How does the entry signal code tell the money management system code which specific stock we are talking about it. It seems that idx is some sort of identifier for each stock but idx variables only turn up in the "money management signals".

It's all kind of confusing from a beginners perspective.

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

Re: [Portfolio] Link b/ "Signal" and "Money Management Signa

Postby Henry MultiСharts » 25 Jan 2016

Hello bluefightingcat,

You can find the answers to these questions in the Portfolio Trader documentation and strategy examples. Please study the available information to learn how to use the new features and keywords:
https://www.multicharts.com/trading-sof ... lio_Trader
Portfolio Money Management Keywords:
https://www.multicharts.com/trading-sof ... M_Keywords
Portfolio Trader Strategy Examples:
https://www.multicharts.com/trading-sof ... y_Examples

As for the programming operators - they work the same way as in the C#. Please refer to MSDN for details:
https://msdn.microsoft.com/en-us/library/sa7629ew.aspx
https://msdn.microsoft.com/en-us/library/2y9zhhx1.aspx


Return to “MultiCharts”