Difference between revisions of "ChangeMarketPosition"

From MultiCharts
Jump to navigation Jump to search
Line 14: Line 14:
 
== Notes ==
 
== Notes ==
 
* Can be used as a mean of synchronization of strategy market position with a broker.  
 
* Can be used as a mean of synchronization of strategy market position with a broker.  
* When auto trading is off the order will '''not''' be sent to a broker.  
+
* When auto trading is off the order will '''not''' be sent to a broker.
 
+
* Also see the related [[PlaceMarketOrder]] keyword.
 +
 
 
== Examples ==
 
== Examples ==
 
<syntaxhighlight>If MarketPosition = 2 then  
 
<syntaxhighlight>If MarketPosition = 2 then  

Revision as of 09:37, 9 February 2012

Places the order with set name and price on the chart.

Usage

ChangeMarketPosition(Delta, Price, Name)

Where:

Delta - number of contracts by which current market position should be changed;
Price - order filling price;
Name - name of the order that changes the position.

Notes

  • Can be used as a mean of synchronization of strategy market position with a broker.
  • When auto trading is off the order will not be sent to a broker.
  • Also see the related PlaceMarketOrder keyword.

Examples

If MarketPosition = 2 then 
   ChangeMarketPosition(-2, 100, "LX");

Will place close order with the name “LX” and the price 100 if current marketposition = 2.

If MarketPosition = 0 then 
   ChangeMarketPosition(-2, 100, "SE");

Will place open order with the name “SE” and the price 100 if current marketposition = 0.