Difference between revisions of "Limit Order Execution Assumptions for Portfolio Backtester"

From MultiCharts
Jump to navigation Jump to search
Line 5: Line 5:
  
 
There are 4 different variants:
 
There are 4 different variants:
# Chart resolution is 1 tick or Bar Magnifier of any resolution is enabled. Backtesting Assumptions is set to '''Fill limit order when trade takes place at limit price or better'''.<div style="background-color: #E5F6FF;">'''Example''': Generated order: sellshort limit @ 121; available prices: 120, 122, 125, ...; order is filled @ 122.</div>
+
# Instrument resolution is '''not''' 1 tick. Backtesting Assumptions is set to '''Fill limit order when trade takes place at limit price or better'''.<div style="background-color: #E5F6FF;">'''Example''': Generated order: sellshort limit @ 121; order is filled @ 121 or better if 121 (or better) is between High and Low of the bar.</div>
# Chart resolution is 1 tick or Bar Magnifier of any resolution is enabled. Backtesting Assumptions is set to '''Fill limit order when trade price goes beyond limit price by 3 points'''.<div style="background-color: #E5F6FF;">'''Example''': Generated order: sellshort limit @ 121; available prices: 120, 122, 125, ...; order is filled @ 125.
+
# Instrument resolution is '''not''' 1 tick. Backtesting Assumptions is set to '''Fill limit order when trade price goes beyond limit price by 3 points'''.<div style="background-color: #E5F6FF;">'''Example''': Generated order: sellshort limit @ 121; order is filled @ 121 if 124 price is between High and Low; order is not filled at all if there is not 124 price between High and Low of the bar.
# Chart resolution is '''not''' 1 tick and Bar Magnifier is not enabled. Backtesting Assumptions is set to '''Fill limit order when trade takes place at limit price or better'''.<div style="background-color: #E5F6FF;">'''Example''': Generated order: sellshort limit @ 121; order is filled @ 121 or better if 121 (or better) is between High and Low of the bar.</div>
 
# Chart resolution is '''not''' 1 tick and Bar Magnifier is not enabled. Backtesting Assumptions is set to '''Fill limit order when trade price goes beyond limit price by 3 points'''.<div style="background-color: #E5F6FF;">'''Example''': Generated order: sellshort limit @ 121; order is filled @ 121 if 124 price is between High and Low; order is not filled at all if there is not 124 price between High and Low of the bar.
 
  
  

Revision as of 17:11, 2 August 2021

Limit orders are filled at a specific price or better (for long better = lower, for short better = higher). Portfolio Backtester works with all prices between Open, High, Low, Close of a bar, assuming that all these prices are real, since Bar Magnifier feature is not available for Portfolio Backtester.

Limit order execution behavior for backtesting can be modified in the Backtesting tab of Strategy Properties window. To open this window, make a right-click on "Strategy 1" in Portfolio Tree and select Show Properties....

There are 4 different variants:

  1. Instrument resolution is not 1 tick. Backtesting Assumptions is set to Fill limit order when trade takes place at limit price or better.
    Example: Generated order: sellshort limit @ 121; order is filled @ 121 or better if 121 (or better) is between High and Low of the bar.
  2. Instrument resolution is not 1 tick. Backtesting Assumptions is set to Fill limit order when trade price goes beyond limit price by 3 points.
    Example: Generated order: sellshort limit @ 121; order is filled @ 121 if 124 price is between High and Low; order is not filled at all if there is not 124 price between High and Low of the bar.


Since MultiCharts 11 it is possible to specify TIF (time in force) for Backtesting Assumptions in Portfolio. At the moment only 2 TIFs are available: GTC and DAY. To specify the TIF right-click on the strategy in Portfolio Tree and choose Show Properties. Then go to Backtesting tab and select Fill limit order when trade price goes beyond limit price by … points, and then the selection of TIFs will be activated.