699
edits
m (→Parameters) |
No edit summary |
||
Line 9: | Line 9: | ||
:'''Side''' - a numerical expression specifying the entry type (e.g. 1 Long entry or -1 Short entry). | :'''Side''' - a numerical expression specifying the entry type (e.g. 1 Long entry or -1 Short entry). | ||
:'''Contracts''' - an optional parameter specifying the number of contracts. | :'''Contracts''' - an optional parameter specifying the number of contracts. | ||
::If the Contracts parameter is not specified | ::If the Contracts parameter is not specified then the number of contracts indicated in the [[Portfolio Settings|Format Settings]] dialog window under the '''Properties''' tab is used by default. | ||
:'''Price''' - an optional parameter specifying the price value. | :'''Price''' - an optional parameter specifying the price value. | ||
::If the Price parameter is not specified, then the [[Close]] price value of the current bar will be used by default. This parameter can be rounded down if entered a Short position or rounded up if entered a Long position. | ::If the Price parameter is not specified, then the [[Close]] price value of the current bar will be used by default. This parameter can be rounded down if entered a Short position or rounded up if entered a Long position. | ||
== Notes == | == Notes == | ||
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.''' | |||
== Examples == | == Examples == | ||
Line 21: | Line 23: | ||
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (1, 100, Close)</syntaxhighlight> | <syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (1, 100, Close)</syntaxhighlight> | ||
Will return the maximum potential loss (not including margin, | Will return the maximum potential loss (not including margin, commission or slippage) if user entered a Long position for 100 contracts at the Close price. | ||
the Close price. | |||
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (-1, 5, Open)</syntaxhighlight> | <syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (-1, 5, Open)</syntaxhighlight> | ||
Will return the maximum potential loss (not including margin, | Will return the maximum potential loss (not including margin, commission or slippage) if user entered a Short position for 5 contracts at the Open price. | ||
Open price. | |||
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (1)</syntaxhighlight> | <syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (1)</syntaxhighlight> | ||
Will return the maximum potential loss (not including margin, | Will return the maximum potential loss (not including margin, commission or slippage) if the user entered a Long position for a number of contracts indicated in the Format Settings dialog window under the Properties tab at Close price. | ||
contracts indicated in the Format Settings dialog window under the Properties tab at Close price. | |||
[[Category:Portfolio Strategy Position]] | [[Category:Portfolio Strategy Position]] |