×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

CurrentContracts

565 bytes added, 07:35, 4 February 2012
no edit summary
Returns an absolute numerical value, indicating the number of contracts or shares held in the current position.
==== Usage ====
<syntaxhighlight>CurrentContracts</syntaxhighlight>
==== Notes ==== This function can only be used in signals. To use the CurrentContracts or [[CurrentShares]] in an indicator, see [[i_CurrentContracts]] and [[i_CurrentShares]] respectively. == Example ==<syntaxhighlight>CurrentContracts</syntaxhighlight>Will return a value of "1" if the strategy is long 1 contract or share. <syntaxhighlight>CurrentContracts</syntaxhighlight>Will return a value of "5" for 5 shares short.
==== Example ====CurrentContracts returns an absolute value for both long and short positions. Multiply it with the [[MarketPosition]] to get the negative sign for short positions. For example:<syntaxhighlight>MarketPosition(0) * CurrentContracts </syntaxhighlight>Will return a value of "-9" if the strategy is short 9 contracts, and will return a value of 1 for 1 contract "4" if the strategy is long four contracts.
CurrentContracts will return a value of 5 for 5 shares short</syntaxhighlight>
[[Category:Strategy Position]]