Difference between revisions of "Why There Is Mismatch On Strategy Positions Tab"

From MultiCharts
Jump to navigation Jump to search
Line 1: Line 1:
In the [[Order and Position Tracker]] window on one of its tabs that is called [[Order and Position Tracker#Strategy Positions tab|Strategy Position]] there is '''Positions Match''' column. It shows you if a strategy position and net position at broker are the same or not: '''True''' (position at broker matches strategy position) or '''False''' (position at broker does not match strategy position) status. It is important to understand that market position on a particular chart is meant under "Strategy Position". Below you can see all cases when it can be False.
+
In the [[Order and Position Tracker]] window, on one of its tabs that is called [[Order and Position Tracker#Strategy Positions tab|Strategy Position]] there is a '''Positions Match''' column. It shows you if a strategy position and net position at the broker are the same or not: '''True''' (the position at the broker matches the strategy position) or '''False''' (the position at the broker does not match the strategy position) status. It is important to understand that the market position on a particular chart is meant under the "Strategy Position". Below you can see all the times when it can be False.
  
 
== Position Match = True ==
 
== Position Match = True ==
Constant position match is expected if the following criterion are met:
+
Constant position match is expected if the following criteria are met:
 
* No manual orders are placed
 
* No manual orders are placed
* Only 1 chart with the particular symbol is auto trading at particular broker account
+
* Only 1 chart with the particular symbol is auto trading at the particular broker account
 
* Synchronous mode of auto trading is used
 
* Synchronous mode of auto trading is used
* Each order receives its final status from broker
+
* Each order receives its final status from the broker
  
 
== Expected Mismatch Cases ==
 
== Expected Mismatch Cases ==
  
 
=== Auto Trading in Asynchronous Mode ===
 
=== Auto Trading in Asynchronous Mode ===
When a strategy is auto trading in [[Auto Trading#Mode Selection|Asynchronous Mode]], the strategy position on chart is formed by all orders that are displayed, including the orders from backtesting, which are not taken into account at broker. The orders generated and displayed on chart during real-time calculation are not guaranteed to be sent from MultiCharts though broker plug-in and be executed. So it means the picture you see on the chart may be unrealistic (executed orders, market position). One should not expect position match to be always true if the mode of auto trading is Asynchronous.  
+
When a strategy is auto trading in [[Auto Trading#Mode Selection|Asynchronous Mode]], the strategy position on the chart is formed by all orders that are displayed, including the orders from backtesting, which are not taken into account at the broker. The orders generated and displayed on the chart during real-time calculation are not guaranteed to be sent from MultiCharts though broker plug-in and be executed. This means the picture you see on the chart may be unrealistic (executed orders, market position). One should not expect a position match to be always true if the auto trading's mode is Asynchronous.  
 
There are 3 places where orders are executed and positions are opened/closed:  
 
There are 3 places where orders are executed and positions are opened/closed:  
 
# '''Broker end''',  
 
# '''Broker end''',  
 
# '''MultiCharts auto trading engine''',  
 
# '''MultiCharts auto trading engine''',  
 
# '''Chart in MultiCharts'''.  
 
# '''Chart in MultiCharts'''.  
If everything set up correctly and working flawlessly (without any errors, manual orders or issues) in synchronous mode [SA] all these 3 places should be synchronized; in asynchronous mode [AA] visual order execution on chart may be up to 100% different from broker end.
+
If everything is set up correctly and working flawlessly (without any errors, manual orders or issues) in synchronous mode [SA], all these 3 places should be synchronized; in asynchronous mode [AA], visual order execution on the chart may be almost 100% different from the broker's end.
  
 
=== Combining Manual Trading and Auto trading ===
 
=== Combining Manual Trading and Auto trading ===
By its design, an auto trading strategy cannot be synchronized with any manual orders (both pending and executed). Execution of manual orders changes net market position at broker, but this is not taken into account for the strategy by default. To learn more about this case and find out how manual and auto trading can be combined, please read [[Manual Trading and Automated Trading on the Same Instrument at a Time|this article]].
+
By its design, an auto trading strategy cannot be synchronized with any manual orders (both pending and executed). Execution of manual orders changes net market position at the broker, but, by default, this is not taken into account for the strategy. To learn more about this and find out how manual and auto trading can be combined, please read [[Manual Trading and Automated Trading on the Same Instrument at a Time|this article]].
  
 
=== Auto Trading From Multiple Charts ===
 
=== Auto Trading From Multiple Charts ===
Similar to combining manual and automated trading, having more than 1 chart auto trading the symbol '''X''' at broker account '''Y''' at the same time leads to position mismatch, because strategies on each chart are working individually. To learn more about this case, please read [[Trading from Multiple Charts on One Instrument|this article]].
+
Similar to combining manual and automated trading, having more than 1 chart auto trading the symbol '''X''' at the broker account '''Y''' at the same time leads to position mismatch, because strategies on each chart are working individually. To learn more about this, please read [[Trading from Multiple Charts on One Instrument|this article]].
  
 
== Unexpected Mismatch Case ==
 
== Unexpected Mismatch Case ==
If an order placed by strategy during auto trading doesn't receive its final status (e.g. '''Cancelled''', '''Filled'''), the strategy considers the order to be not executed. In fact the order may be executed at broker end, what leads to position mismatch. The indications of the case are the following statuses for orders in [[Order and Position Tracker]]:
+
If an order placed by the strategy during auto trading doesn't receive its final status (e.g. '''Cancelled''', '''Filled'''), the strategy considers the order to be not executed. In fact, the order may be executed at the broker end, which leads to a position mismatch. Indicators of this are the following statuses for orders in [[Order and Position Tracker]]:
 
* '''PreCancelled'''
 
* '''PreCancelled'''
 
* '''PreModified'''
 
* '''PreModified'''

Revision as of 17:59, 11 June 2014

In the Order and Position Tracker window, on one of its tabs that is called Strategy Position there is a Positions Match column. It shows you if a strategy position and net position at the broker are the same or not: True (the position at the broker matches the strategy position) or False (the position at the broker does not match the strategy position) status. It is important to understand that the market position on a particular chart is meant under the "Strategy Position". Below you can see all the times when it can be False.

Position Match = True

Constant position match is expected if the following criteria are met:

  • No manual orders are placed
  • Only 1 chart with the particular symbol is auto trading at the particular broker account
  • Synchronous mode of auto trading is used
  • Each order receives its final status from the broker

Expected Mismatch Cases

Auto Trading in Asynchronous Mode

When a strategy is auto trading in Asynchronous Mode, the strategy position on the chart is formed by all orders that are displayed, including the orders from backtesting, which are not taken into account at the broker. The orders generated and displayed on the chart during real-time calculation are not guaranteed to be sent from MultiCharts though broker plug-in and be executed. This means the picture you see on the chart may be unrealistic (executed orders, market position). One should not expect a position match to be always true if the auto trading's mode is Asynchronous. There are 3 places where orders are executed and positions are opened/closed:

  1. Broker end,
  2. MultiCharts auto trading engine,
  3. Chart in MultiCharts.

If everything is set up correctly and working flawlessly (without any errors, manual orders or issues) in synchronous mode [SA], all these 3 places should be synchronized; in asynchronous mode [AA], visual order execution on the chart may be almost 100% different from the broker's end.

Combining Manual Trading and Auto trading

By its design, an auto trading strategy cannot be synchronized with any manual orders (both pending and executed). Execution of manual orders changes net market position at the broker, but, by default, this is not taken into account for the strategy. To learn more about this and find out how manual and auto trading can be combined, please read this article.

Auto Trading From Multiple Charts

Similar to combining manual and automated trading, having more than 1 chart auto trading the symbol X at the broker account Y at the same time leads to position mismatch, because strategies on each chart are working individually. To learn more about this, please read this article.

Unexpected Mismatch Case

If an order placed by the strategy during auto trading doesn't receive its final status (e.g. Cancelled, Filled), the strategy considers the order to be not executed. In fact, the order may be executed at the broker end, which leads to a position mismatch. Indicators of this are the following statuses for orders in Order and Position Tracker:

  • PreCancelled
  • PreModified
  • PreSubmitted
  • Saved