×

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.

Difference between revisions of "Pmms strategy close position partial" - MultiCharts
Open main menu

Difference between revisions of "Pmms strategy close position partial"

(Created page with "<i></i> This function closes position of the strategy with Index number with market order (orders generated by the strategy will be deleted from Raw Orders collection). ==Usa...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<i></i>
+
This function partially closes position of the specified strategy for the set number of contracts.
This function closes position of the strategy with Index number with market order (orders generated by the strategy will be deleted from Raw Orders collection).
 
  
 
==Usage==
 
==Usage==
<syntaxhighlight>pmms_strategy_close_position(Index)</syntaxhighlight>
+
<syntaxhighlight>pmms_strategy_close_position_partial(Index, isNextBar, contracts)</syntaxhighlight>
  
==Parameters==
+
Where:
Index - numeric variable.
+
:'''Index''' - numeric variable, strategy index.
 +
:'''isNextBar''' - boolean variable, true - generates open next bar order, false - generates close this bar order.
 +
:'''contracts''' - numeric variable, contracts number.
  
 
==Notes==
 
==Notes==
Line 12: Line 13:
  
 
==Example==
 
==Example==
<syntaxhighlight>pmms_strategy_close_position(0)</syntaxhighlight>
+
Reduce the position of the first symbol of the portfolio for 3 contracts at the next bar open.
 +
<syntaxhighlight>pmms_strategy_close_position_partial(0, true, 3)</syntaxhighlight>
  
 
[[Category:Portfolio_Money_Management]]
 
[[Category:Portfolio_Money_Management]]

Latest revision as of 13:26, 10 April 2017

This function partially closes position of the specified strategy for the set number of contracts.

Usage

pmms_strategy_close_position_partial(Index, isNextBar, contracts)

Where:

Index - numeric variable, strategy index.
isNextBar - boolean variable, true - generates open next bar order, false - generates close this bar order.
contracts - numeric variable, contracts number.

Notes

This function can only be used in signals intended to be used with the Portfolio Trader.

Example

Reduce the position of the first symbol of the portfolio for 3 contracts at the next bar open.

pmms_strategy_close_position_partial(0, true, 3)