Difference between revisions of "Trading from Multiple Charts on One Instrument"

From MultiCharts
Jump to navigation Jump to search
Line 3: Line 3:
 
'''Since hedging is not supported in MultiCharts it is extremely important to understand all possible circumstances clearly to find your own correct way for auto trading from multiple charts on the same instrument. Below one can find useful information of how MultiCharts may behave during such situation.''' <br>
 
'''Since hedging is not supported in MultiCharts it is extremely important to understand all possible circumstances clearly to find your own correct way for auto trading from multiple charts on the same instrument. Below one can find useful information of how MultiCharts may behave during such situation.''' <br>
  
==General Understanding of the Situation==
+
====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 anyway (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:<br>
 
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 anyway (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:<br>
Line 13: Line 13:
 
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.<br>
 
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.<br>
  
 +
====Strategy Synchronizers for Multiple Chart Windows====
 +
 +
Among prebuilt standard signals in MultiCharts there are 2 scripts that were introduced specifially to compare 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 autotrading is considered'''):<br>
 +
1. Placing manual orders when a strategy is auto trading (the same broker, account, instrument)<br>
 +
2. Auto trading from one chart window when a strategy is auto trading on a different chart (the same broker, account, instrument)<br>
  
 
[[Category:AutoTrading]]
 
[[Category:AutoTrading]]

Revision as of 18:01, 19 March 2012


Since hedging is not supported in MultiCharts it is extremely important to understand all possible circumstances clearly to find your own correct way for auto trading from multiple charts on the same instrument. Below one can find useful information of how MultiCharts may behave during such situation.

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 anyway (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:

Example: Market position at broker = 0. Market position on each chart = 0. If your strategy on chart A generates a long entry, then the strategy on chart B doesn't know about it. If the strategy on Chart B goes short, then chart A also doesn't know about it. So the strategies continue trading individually on their charts, preserving their chart positions. However, since the instrument at broker is the same, the market position at broker on the instrument is the net position of the orders sent from both charts. In this example the position will be flat after 1 order from each chart.
If the chart A sends short entry order, which is reverse in fact, then the broker receives 2 commands from MC at this moments: 1) 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 2) 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 on for this instrument becomes -2. The chart B still assumes that the position is -1 meanwhile. Similar scenario but in the opposite direction if the reverce order would have 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

Among prebuilt standard signals in MultiCharts there are 2 scripts that were introduced specifially to compare 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 autotrading is considered):
1. Placing manual orders when a strategy is auto trading (the same broker, account, instrument)
2. Auto trading from one chart window when a strategy is auto trading on a different chart (the same broker, account, instrument)