ChangeMarketPosition: Difference between revisions
From MultiCharts
m (→Notes) |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
Places the | Places an arrow on the chart and changes the market position of the STRATEGY when automated trading is turned on. | ||
It does not send any orders to broker. It is used for synching the marketposition on the chart. | |||
It can be used in conjunction with [[PlaceMarketOrder]] command. | |||
== Usage == | == Usage == | ||
<syntaxhighlight>ChangeMarketPosition(Delta, Price, Name)</syntaxhighlight> | <syntaxhighlight>ChangeMarketPosition(Delta, Price, Name)</syntaxhighlight> | ||
Line 18: | Line 21: | ||
== Examples == | == Examples == | ||
<syntaxhighlight>If MarketPosition = | <syntaxhighlight>If MarketPosition = 1 then | ||
ChangeMarketPosition(- | ChangeMarketPosition(-1, 100, "LX");</syntaxhighlight> | ||
Will place | Will place an order arrow on the chart with the name “LX” and the price 100 if current marketposition = 1. | ||
<syntaxhighlight>If MarketPosition = 0 then | <syntaxhighlight>If MarketPosition = 0 then | ||
ChangeMarketPosition(-2, 100, "SE");</syntaxhighlight> | ChangeMarketPosition(-2, 100, "SE");</syntaxhighlight> | ||
Will place | Will place an order arrow on the chart with the name “SE” and the price 100 if current marketposition = 0. | ||
[[Category:Strategy Position Synchronization]] | [[Category:Strategy Position Synchronization]] |
Latest revision as of 16:41, 23 January 2014
Places an arrow on the chart and changes the market position of the STRATEGY when automated trading is turned on. It does not send any orders to broker. It is used for synching the marketposition on the chart.
It can be used in conjunction with PlaceMarketOrder command.
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 = 1 then
ChangeMarketPosition(-1, 100, "LX");
Will place an order arrow on the chart with the name “LX” and the price 100 if current marketposition = 1.
If MarketPosition = 0 then
ChangeMarketPosition(-2, 100, "SE");
Will place an order arrow on the chart with the name “SE” and the price 100 if current marketposition = 0.