Difference between revisions of "Understanding Automated Trade Execution"

From MultiCharts
Jump to navigation Jump to search
Line 1: Line 1:
After developing a strategy, the next step is to have the strategy actually send the orders. MultiCharts automated trading platform can automate the trading process and seamlessly integrate with any of the supported order execution infrastructures: [[Broker Profiles Overview]].
+
Once a strategy for automated trading is [[Using_Studies_(PowerLanguage_Editor)#Creating_Signals|developed]], [[Understanding_Backtesting|backtested]] and [[Performing_Optimization|optimized]], the next step is to have it actually send the orders to the [[Broker_Profiles_Overview|broker]]. The orders are submitted to the selected broker through the [[Auto_Trading#Select_Broker_Plug-in|auto trading broker plugin]] implemented in MultiCharts.
 +
As opposed to the purely brokerage programs MultiCharts has a capability of combining the [[Built-in_Data_Sources|data sources]] that are different from the desired broker during autotrading. This is realized through the [[Symbol_Mapping|Symbol Mapping]] functionality and provides additional possibilities and advantages for traders.
 +
Automated trading has two primary benefits: convenience and speed. A trader can let the strategy trade automatically without having to constantly monitor the strategy and enter the orders himself (though we don’t recommend leaving the strategy unattended at all!). Automated trading also allows for sending the orders much quicker compared to manual trading. The orders are submitted automatically and the chances of delay are reduced.
 +
MultiCharts offers 2 modes of automated trading: Synchronous and Asynchronous. The modes are fundamentally different. Here’s the overview of each mode.
  
Implementing automated trade execution involves using a program that serves as the order execution gateway on the computer and configuring the link between MultiCharts and the gateway program. Orders, generated by a trading strategy in MultiCharts, are passed to the gateway program for execution. The gateway program is also often used to provide the data feed for MultiCharts, although it is possible and sometimes advantageous to use a different data source.
+
==Synchronous Mode of Auto Trading (SA)==
  
Automated trading has two primary benefits: convenience and speed. The trader can let his strategy trade automatically without having to constantly monitor the strategy and enter the orders himself. Automated trading can also send the orders much quicker.  Certain strategies require orders to be sent as quickly as possible without delay. With auto trading, the trader does not have to manually type the order into the gateway.  The trades are submitted automatically and the chances of delay are reduced.  
+
The synchronous auto trading mode (SA) is the mode in which the trades are only reflected on the chart after the orders have actually been executed on the broker. SA always starts trading from Flat as if there were no previous historical trading results. The strategy is not recalculated on the start of autotrading. When it will be calculated depends on the [[Chart_Resolution|chart resolution]] and the [[Signal_Settings#Intra-Bar_Order_Generation|Intra-Bar Order Generation]] (IOG) setting. If there’s an open position on the broker one can tell the strategy to continue trading from this position. See how to assign the postion [[Auto_Trading#Assign_the_Initial_Market_Position_at_the_Broker_Settings|here]].  
  
In addition to the obvious advantages of convenience, automated trading makes possible the execution of high-frequency trading strategies such as arbitrage, where the acceptable response time for placing orders is too quick for manual order entries.
+
The SA mode should work properly and the autotrading and broker positions should match if the following aspects are avoided:
 +
* [[Trading_from_Multiple_Charts_on_One_Instrument|trading on one and the same instrument/broker account from other charts]];
 +
* starting the trading from a non-flat broker position;
 +
* trading the same instrument in the broker platform at the same time;
 +
* losing the connection to the broker at the moments of order fillings/rejections.
  
Both, Synchronous and Asynchronous auto trading modes are deployed in MultiCharts. These two modes are profoundly different. Select the mode that better suits the strategy on the chart. Synchronous mode makes it possible to show a position on the chart that matches the actual filled position. However there is no guarantee that the order will get filled. When using the Asynchronous mode, not every order generated on the chart is filled and the actual execution time and price can be different from the time and price shown on the chart.
+
==Asynchronous Mode of Auto Trading (AA)==
  
<br>
+
The asynchronous auto trading mode (AA) is the mode in which the trades are plotted on the chart when the order generation conditions are met with no respect to the real order executions on the broker. In this aspect auto trading in AA is more like backtesting with the only difference: the orders are actually sent to the broker. The AA mode continues trading from the current backtesting position. As with the SA mode it is possible to [[Auto_Trading#Assign_the_Initial_Market_Position_at_the_Broker_Settings|assign the starting position]] for auto trading, but this cannot guarantee that the [[Why_There_Is_Mismatch_On_Strategy_Positions_Tab|broker and strategy position mismatches]] won’t happen later in the course of auto trading. One should not expect the order execution prices on the chart to coincide with the order execution prices on the broker because this mode is not synchronized with the broker as is suggested by the mode's name.
[[Category:AutoTrading]]
 
=== Synchronous Mode for Auto Trading ===
 
 
 
The synchronous auto trading mode (SA) is a mode where entry/exit arrows are plotted on the chart only after orders have been executed at the broker.  
 
 
 
The synchronous auto trading mode ensures avoiding discrepancies between the market position on the chart and the market position at the broker. The following conditions must be met in order for the synchronous auto trading mode to work properly:
 
  
# The same symbol can be traded from more than one chart but it may cause a market position conflict between the charts. For more information see [[Trading from Multiple Charts on One Instrument]] section.
 
# The market position at the broker must be 0 at the time when auto trading is launched. If it is not 0, the [[Auto Trading#Assign the Initial Market Position at the Broker Settings|possition should be assigned]].
 
# A trader must not trade the symbol directly through the broker's platform while trading the same symbol through MultiCharts platform.
 
# At the moment of connection loss, the broker did not send notifications about complete order filling or cancellation.
 
  
<br>
 
  
=== Asynchronous Mode for Auto Trading ===
+
== Comparison of Synchronous and Asynchronous Mode ==
 
 
The asynchronous auto trading mode (AA) is the mode where entry/exit arrows are plotted on the chart when the price value meets the strategy conditions.
 
 
 
However, order execution by the broker is not guaranteed if the conversion of unexecuted limit/stop entry orders is disabled. It may cause a market position conflict between the chart and the broker.
 
 
 
Enabling order conversion guarantees that an order will be filled at the broker, although the executed order price value could be different from the order price plotted on the chart.
 
 
 
<br>
 
=== Comparison of Synchronous and Asynchronous Mode ===
 
  
 
{| class="wikitable" width="75%"
 
{| class="wikitable" width="75%"
Line 49: Line 36:
 
|}
 
|}
 
<br>
 
<br>
 +
[[Category:AutoTrading]]

Revision as of 17:45, 18 July 2019

Once a strategy for automated trading is developed, backtested and optimized, the next step is to have it actually send the orders to the broker. The orders are submitted to the selected broker through the auto trading broker plugin implemented in MultiCharts. As opposed to the purely brokerage programs MultiCharts has a capability of combining the data sources that are different from the desired broker during autotrading. This is realized through the Symbol Mapping functionality and provides additional possibilities and advantages for traders. Automated trading has two primary benefits: convenience and speed. A trader can let the strategy trade automatically without having to constantly monitor the strategy and enter the orders himself (though we don’t recommend leaving the strategy unattended at all!). Automated trading also allows for sending the orders much quicker compared to manual trading. The orders are submitted automatically and the chances of delay are reduced. MultiCharts offers 2 modes of automated trading: Synchronous and Asynchronous. The modes are fundamentally different. Here’s the overview of each mode.

Synchronous Mode of Auto Trading (SA)

The synchronous auto trading mode (SA) is the mode in which the trades are only reflected on the chart after the orders have actually been executed on the broker. SA always starts trading from Flat as if there were no previous historical trading results. The strategy is not recalculated on the start of autotrading. When it will be calculated depends on the chart resolution and the Intra-Bar Order Generation (IOG) setting. If there’s an open position on the broker one can tell the strategy to continue trading from this position. See how to assign the postion here.

The SA mode should work properly and the autotrading and broker positions should match if the following aspects are avoided:

Asynchronous Mode of Auto Trading (AA)

The asynchronous auto trading mode (AA) is the mode in which the trades are plotted on the chart when the order generation conditions are met with no respect to the real order executions on the broker. In this aspect auto trading in AA is more like backtesting with the only difference: the orders are actually sent to the broker. The AA mode continues trading from the current backtesting position. As with the SA mode it is possible to assign the starting position for auto trading, but this cannot guarantee that the broker and strategy position mismatches won’t happen later in the course of auto trading. One should not expect the order execution prices on the chart to coincide with the order execution prices on the broker because this mode is not synchronized with the broker as is suggested by the mode's name.


Comparison of Synchronous and Asynchronous Mode

Mode Pro Con
Synchronous Only orders filled at the broker will be displayed on the chart with the exact same price value as at the broker. Possibility of non‑execution of entry orders at the broker such as Limit or Stop as a result of not meeting theoretical conditions set on the chart.
Asynchronous An ability to convert entry orders such as Limit or Stop to Market orders if the defined price mark was not met within indicated amount of time. Market orders ensure that the order will be filled at the broker and market position will stay the same on the chart and the broker, but they don't guarantee the price at which the order will be executed. If order converting is disabled, then orders that will be generated on the chart may never be filled at the broker. Thus, the actual position at the broker may not be the same as the position shown on the chart.