461
edits
(3 intermediate revisions by one other user not shown) | |||
Line 63: | Line 63: | ||
=== Cancel Expired Market Orders After X Seconds === | === Cancel Expired Market Orders After X Seconds === | ||
Market orders that were not filled within the specified time (30 seconds by default) will be canceled. | |||
<div style="background-color: #E5F6FF;">'''Example''': 30 second timeout is set;<br>12:00:00 Strategy Calculation at close of bar # 51 - place market order to buy at open of next bar;<br>12:00:01 Strategy Calculation at open of bar # 52 - market order to buy is placed at broker;<br>12:00:10 Strategy Calculation at close of bar # 52 - no market order to buy at open of next bar should be placed;<br>Default 30 second countdown | <div style="background-color: #E5F6FF;">'''Example''': Default 30 second timeout is set;<br>12:00:00 Strategy Calculation at close of bar # 51 - place market order to buy at open of next bar;<br>12:00:01 Strategy Calculation at open of bar # 52 - market order to buy is placed at broker;<br>12:00:10 Strategy Calculation at close of bar # 52 - no market order to buy at open of next bar should be placed;<br> Default 30 second countdown starts:<br>12:00:40 - market order is cancelled.</div> | ||
<br> | <br> | ||
Line 104: | Line 104: | ||
With the help of these options one can have unexecuted entry/exit price orders converted into market orders when the specified timeout is exceeded or upon bar close. | With the help of these options one can have unexecuted entry/exit price orders converted into market orders when the specified timeout is exceeded or upon bar close. | ||
The timer is launched depending on the option “Get | The timer is launched depending on the option “Get Real-Time Data from” and the mode of auto trading. | ||
In '''SA''' mode: | |||
* when set to “Broker”, the timer starts when the '''price at the broker''' touches the order’s price; | * when set to “Broker”, the timer starts when the '''price at the broker''' touches the order’s price; | ||
* when set to “Chart”, the timer starts when the order price is hit '''on a chart'''. | * when set to “Chart”, the timer starts when the order price is hit '''on a chart'''. | ||
Line 112: | Line 113: | ||
<div style="background-color: #E3FBE5;">'''Note''': If the order price is not hit at broker/chart then the order will not be converted.</div> | <div style="background-color: #E3FBE5;">'''Note''': If the order price is not hit at broker/chart then the order will not be converted.</div> | ||
<br> | <br> | ||
In '''AA''' mode conversion will start when an order is filled on a chart. | |||
The conversion algorithm is the following: | |||
# The Auto trading engine system receives an order filling event on the chart. | |||
#* If an identical order is now placed on the broker, the timer for conversion is launched. | |||
#* If this order is not placed on the broker yet, MultiCharts remembers that on this bar it is necessary to convert this particular order. | |||
# The Auto Trading engine places an order that needs conversion. The timer for conversion is launched. | |||
=== Partially Filled Orders Replacement === | === Partially Filled Orders Replacement === | ||
Line 135: | Line 142: | ||
<div style="background-color: #E5F6FF;">'''Example''': | <div style="background-color: #E5F6FF;">'''Example''': | ||
Auto trading mode is Async. (see [[Understanding Automated Trade Execution]]), Get Real-Time from Chart is selected, there is an executed entry and a trailing stop is sent. The trailing order price is calculated based on the entry order fill price at the broker and the real-time price from the chart.</div> | Auto trading mode is Async. (see [[Understanding Automated Trade Execution]]), Get Real-Time from Chart is selected, there is an executed entry and a trailing stop is sent. The trailing order price is calculated based on the entry order fill price at the broker and the real-time price from the chart.</div> | ||
# From Broker: Asks and Bids are taken from the connected broker. | # From Broker: Asks and Bids are taken from the connected broker.<div style="background-color: #E3FBE5;">'''Note''': '''From Broker''' option is not available for asynchronous mode [AA]</div> | ||
# From Chart: depends on the BackTesting Mode:<BR> | # From Chart: depends on the BackTesting Mode:<BR> | ||
::a) If it is Classic Backtesting, then the data is taken from the data series 1;<BR> | ::a) If it is Classic Backtesting, then the data is taken from the data series 1;<BR> | ||
Line 166: | Line 173: | ||
===Assign Initial Market Position to Strategy=== | ===Assign Initial Market Position to Strategy=== | ||
When auto trading is turned on, a strategy starts working with a specific market position.<br> | |||
Depending on the mode of auto trading, this position can vary. In [SA] mode it is always flat on chart when you turn it on, but in [AA] mode it can be short, flat or long, depending on backtesting trades (to learn more see [[#Mode_Selection|Mode Selection]]).<br> | |||
This option allows to control the initial market position for the strategy to start calculation and order generation with when you turn on auto trading. | |||
The available options are: | The available options are: | ||
:* '''Flat ''' - the initial position will be flat. | :* '''Flat ''' - the initial position will be flat.<br> <div style="background-color: #E3FBE5;">'''Example''': According to your backtesting, the current position is 1 contract long and your real broker position is 1 contract short. With this option you will have +1 on your chart, flat for auto trading engine within the software and -1 short at broker, when the automation is turned on. </div> | ||
<div style="background-color: #E3FBE5;">'''Example''': | |||
:* '''From Chart''' - the initial position will be the same as the position on the chart. | :* '''From Chart''' - the initial position will be the same as the position on the chart. | ||
:* '''From Broker''' - the initial position will be the same as actual position at the broker when automation is enabled. | :* '''From Broker''' - the initial position will be the same as the actual position at the broker when automation is enabled. | ||
:* '''Always show dialog window''' - to get the dialog every time the automation is enabled, no matter what | :* '''Always show dialog window''' - to get the dialog every time the automation is enabled, no matter what the strategy position is at that moment.<br> <div style="background-color: #E3FBE5;">'''Note''': It is extremely important for [SA] mode, because it is always flat when automation is turned on in [SA].</div> | ||
<div style="background-color: #E3FBE5;">'''Note''': It is extremely important for [SA] mode, because it is always flat when automation is turned on in [SA].</div> | |||
:* '''Show dialog window only if market position on chart is different from broker''' - to get the dialog when the chart and broker positions do not match. | :* '''Show dialog window only if market position on chart is different from broker''' - to get the dialog when the chart and broker positions do not match. | ||