The newly set value is valid during the strategy calculation or until the Portfolio_SetMaxPotentialLossPerContract is requested again assigning a new value.
- NewValue - a numerical value that can be:
- An absolute value in the range [-100, -0.001]; defines percentage of the maximum potential loss per contract. (Max Potential Loss: %).
- a value in the range [0.001, 1e+29]; defines the maximum potential loss per contract in dollars. (Absolute Max Potential Loss: ¤).
- equal 0; in this case the value entered in the Format Settings dialog window under the Portfolio Settings tab is used.
- True if the value is in one of the ranges indicated above. Redefining is considered to be successful.
- False if the value is out of the ranges indicated above. Redefining is considered unsuccessful and the Max Potential Loss value is unchanged.
- This function can only be used in signals intended to be used with the Portfolio Trader.
- The value is returned in the currency specified in Portfolio Trader: Portfolio Settings -> Base Currency.
If "MSFT" = SymbolName then Portfolio_SetMaxPotentialLossPerContract(-10);
The new value of -10 is assigned for the symbol "MSFT" only if such symbol is exist in the portfolio.
Redefines the percentage value of the maximum potential loss per contract for 5%.
Redefines the maximum potential loss per contract for ¤200.