+1 888 340 6572

ChangeMarketPosition: Difference between revisions

From MultiCharts
mNo edit summary
No edit summary
Line 1: Line 1:
Places the order with set name and price on the chart. Though when auto trading is off the order will not be sent to a broker.  
Places the order with set name and price on the chart.  
   
   
==== Usage ====
== Usage ==
<syntaxhighlight>ChangeMarketPosition (Delta, Price, Name)</syntaxhighlight>  
<syntaxhighlight>ChangeMarketPosition(Delta, Price, Name)</syntaxhighlight>  


Where:  
Where:  
Line 12: Line 12:
:'''Name''' - name of the order that changes the position.  
:'''Name''' - name of the order that changes the position.  
   
   
==== 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.
==== Example ====  
 
== Examples ==
<syntaxhighlight>If MarketPosition = 2 then  
<syntaxhighlight>If MarketPosition = 2 then  
   ChangeMarketPosition (-2,100,"LX");</syntaxhighlight>  
   ChangeMarketPosition (-2,100,"LX");</syntaxhighlight>  
Will place close order with the name “LX” and the price 100 if current marketposition = 2.  
Will place close order with the name “LX” and the price 100 if current marketposition = 2.  


<syntaxhighlight>If MarketPosition = 0 then  
<syntaxhighlight>If MarketPosition = 0 then  
   ChangeMarketPosition (-2,100,"SE");</syntaxhighlight>  
   ChangeMarketPosition (-2,100,"SE");</syntaxhighlight>  
Will place open order with the name “SE” and the price 100 if current marketposition = 0.  
Will place open order with the name “SE” and the price 100 if current marketposition = 0.  


[[Category:Strategy Position Synchronization]]
[[Category:Strategy Position Synchronization]]