PlaceMarketOrder
From MultiCharts
Places a market order at the broker immediately after the script calculation without position changing on the chart.
Usage
PlaceMarketOrder(IsBuy, IsEntry, Contracts)
Where:
- IsBuy - indicates whether order is buy or sell;
- IsEntry - indicates whether order is entry or exit;
- Contracts - indicates the number of contracts/shares of the order.
Notes
- Works only with auto trading turned on.
- Can be used as a mean of synchronization of strategy market position with a broker.
- Also see the related ChangeMarketPosition keyword.
Example
If MarketPosition*CurrentContracts = 2 and MarketPosition_at_Broker = 4 then PlaceMarketOrder (false, false, 2);
Will generate sell market order for 2 contracts to synchronize market position at broker with the strategy position.
Please refer to !From Strategy To Broker MP Synchronizer! default signal for more examples.