Trading from Multiple Charts on One Instrument
General Understanding of the Situation
When a customer uses 2 or more separate charts and auto trade from these charts on the same instrument on the same account of the same broker, then the strategies that are used on the charts are not connected in any way (if global variables are not used in their scripts to pass values between them).
Even if MarketPosition_at_broker is used, it simply can get the real position from broker, but the actual position on chart may differ in this case. The following example can demonstrate a simple possible scenario of trading from 2 charts on the same instrument:
If the chart A sends short entry order after this, which is reverse in fact, then the broker receives 2 contracts order from MC at this moments: 1 contract is to close open +1 long position (chart A assumes that it is still open) that is in fact an order to sell 1 contract; and another 1 contract is to open -1 short position. If we take into consideration that the real broker position by that moment is 0, then it gets sell 1 contract and sell another 1 contract, the actual position at broker for this instrument becomes -2. The chart B still assumes that the position is -1 meanwhile. Similar scenario but in the opposite direction would have taken place if the reverse order had been sent from chart B.
The main thing one should keep in mind trading from different chart windows by script on the same broker instrument is that the real broker position in most cases does not match chart positions.
Strategy Synchronizers for Multiple Chart Windows and Manual Orders During Enabled Auto Execution
Among prebuilt standard signals in MultiCharts there are 2 scripts that were introduced specifically for comparing market positions at broker and on chart to synchronize one of them with the other if they differ. Essentially there are 2 possible expected scenarios when market positions can get out of synch (only SA mode of auto trading is considered):
- Placing manual orders when a strategy is auto trading (the same broker, account, instrument).
- Auto trading from one chart window when a strategy is auto trading on a different chart (the same broker, account, instrument).
Depending on the direction of synchronization, the strategy works in 2 different ways:
!From Broker To Strategy MP Synchronizer!
The strategy checks the market position at broker and then checks chart market position. If the positions are different, then the signal generates an emulated order with the number of contracts and average entry price as on broker end to match the broker position. The order is not sent to broker, so it affects only market position on chart for the strategy. It is displayed on the chart, but it is not shown in Order and Position Tracker window.
!From Strategy To Broker MP Synchronizer!
The strategy checks the market position at broker and then checks chart market position. If the positions are different, then the signal generates a market order with the number of contracts to match the chart position. The order is sent to broker, but the strategy itself is not aware of market position change, so it affects only broker position.
Find more info on MultiCharts Forum.