This script has Automatic Instrument Context by default. This means, when this script section executes, it is given direct access to all IPV Properties and Functions.
NOTE:
This scripts section will not normally execute when a instrument specific date record is not in the instrument's data file.
A current record is a record date for the same test date on which this script is executing. This means a test date must have an instrument date price record in order for this script section to execute.
When it does have a missing instrument record any orders that were active for the active test date, orders will not be filled or expired by the brokerage process. However, when an order is still active after the brokerage process, it will be available to execute an order fill or allowed to expire on the next available instrument date trading session.
Indicator calculations are updated to the data date being used for test date. The instrument date is equal to the test date in the After Instrument Open after the Open. This means the OHLC and all indicators for the the test date are updated and available.
From a test date perspective, the Entry Orders script runs using the instrument data prior to the test date. Then the access within the After Instrument Open script follows these rules:
1.The last nearest Instrument date is brought forward to the active test date.
2.Update Indicators script updates all custom indicators are synchronized with the OHLC and the regular and calculated indicators.
3.After Instrument Open script runs with access to all this test date data.
4.As mentioned, active trading orders on order generation day are run using the very last bar.
5.The the data process stops at the Before Order Execution script.
6.All the next day orders are computed for the test date and are output to the order report.
7.All the subsequent scripts that require the trade day data are not run.
WARNING:
The After Instrument Open script is an advanced script that is not recommended for most users. It is available to enable experienced system developers to write systems that have special order processing logic based on the relationships between the open, highs and lows.
Since this script is called after the current bar is set for each instrument (see Comprehensive Simulation Loop), the entire bar's price data in the instrument file is available. For this reason, it is possible to write systems with postdictive information that are unavailable in live trading. They are unavailable in live trading because the market is still open, but the file data that is the source of the instrument prices has not been released and loaded into the data file.
In simple terms, making decisions using postdictive information that is not be available in active trading when the market is strill trading leaves a data hole in the strategy. . If you want to create orders which are based on a bar's open, use the tradeDayOpen instrument property in the Entry Orders script.
Edit Time: 11/12/2020 11:24:20 AM |
Topic ID#: 298 |