Difference between revisions of "Portfolio CalcMaxPotentialLossForEntry"

From MultiCharts
Jump to navigation Jump to search
m (Reverted edits by 176.8.90.7 (talk) to last revision by 194.84.116.138)
Line 1: Line 1:
Calculates and returns maximum potential loss (not including margin, commision or slippage) if user entered the position with the number of [[Contracts]] and [[Price]] of entry.   
+
Calculates and returns the maximum potential loss (not including margin, commission or slippage) if the user entered the position with the number of [[Contracts]] and [[EntryPrice|Price of entry]].   
  
==== Usage ====
+
== Usage ==
 
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (Side <,Contracts <,Price>>);</syntaxhighlight>  
 
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (Side <,Contracts <,Price>>);</syntaxhighlight>  
  
Parameters inside the angled brackets are optional  
+
Parameters inside the angled brackets are optional - if these aren't defined, the default is used.
  
==== Parameters ====  
+
== Parameters ==
 
+
:'''Side''' - a numerical expression specifying the entry type (e.g. 1 Long entry or -1 Short entry).
Side is 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.  
 
+
::If the Contracts parameter is not specified, then the number of contracts indicated in the '''Format Settings''' dialog window under the '''Properties''' tab is used by default.  
[[Contracts]] is an optional parameter specifying the number of contracts. If the Contracts parameter is not specified, then the number of contracts indicated in the [[Format Settings]] dialog window under the [[Properties]] tab is used by default.  
+
:'''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.  
[[Price]] is 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.  
 
 
   
 
   
==== Notes ====  
+
== Notes ==
This function can only be used in signals intended to be used with the Portfolio Backtester.  
+
* This function can only be used in signals intended to be used with the [[:Category:Portfolio_Backtesting|Portfolio Backtester]].
 
   
 
   
==== Example ====
+
== Examples ==
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (0, 25, High) will return a value of 0, since the parameter  
+
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (0, 25, High)</syntaxhighlight>
Side=0  
+
Will return a value of 0, since the parameter ''Side'' is 0.
  
Portfolio_CalcMaxPotentialLossForEntry (1, 100, Close) will return the maximum potential loss  
+
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (1, 100, Close)</syntaxhighlight>
(not including margin, commision or slippage) if user entered a Long position for 100 contracts at
+
Will return the maximum potential loss (not including margin, commision or slippage) if user entered a Long position for 100 contracts at
 
the Close price.  
 
the Close price.  
  
Portfolio_CalcMaxPotentialLossForEntry (-1, 5, Open) will return the maximum potential loss  
+
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (-1, 5, Open)</syntaxhighlight>
(not including margin, commision or slippage) if user entered a Short position for 5 contracts at
+
Will return the maximum potential loss (not including margin, commision or slippage) if user entered a Short position for 5 contracts at
 
Open price.  
 
Open price.  
  
Portfolio_CalcMaxPotentialLossForEntry (1) will return the maximum potential loss  
+
<syntaxhighlight>Portfolio_CalcMaxPotentialLossForEntry (1)</syntaxhighlight>
(not including margin, commision or slippage) if the user entered a Long position for a number of
+
Will return the maximum potential loss (not including margin, commision 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.</syntaxhighlight>
+
contracts indicated in the Format Settings dialog window under the Properties tab at Close price.
 
 
  
 
[[Category:Portfolio Strategy Position]]
 
[[Category:Portfolio Strategy Position]]

Revision as of 14:30, 19 February 2012

Calculates and returns the maximum potential loss (not including margin, commission or slippage) if the user entered the position with the number of Contracts and Price of entry.

Usage

Portfolio_CalcMaxPotentialLossForEntry (Side <,Contracts <,Price>>);

Parameters inside the angled brackets are optional - if these aren't defined, the default is used.

Parameters

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.
If the Contracts parameter is not specified, then the number of contracts indicated in the Format Settings dialog window under the Properties tab is used by default.
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.

Notes

Examples

Portfolio_CalcMaxPotentialLossForEntry (0, 25, High)

Will return a value of 0, since the parameter Side is 0.

Portfolio_CalcMaxPotentialLossForEntry (1, 100, Close)

Will return the maximum potential loss (not including margin, commision or slippage) if user entered a Long position for 100 contracts at the Close price.

Portfolio_CalcMaxPotentialLossForEntry (-1, 5, Open)

Will return the maximum potential loss (not including margin, commision or slippage) if user entered a Short position for 5 contracts at Open price.

Portfolio_CalcMaxPotentialLossForEntry (1)

Will return the maximum potential loss (not including margin, commision 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.