InstrumentProcessorBase
This class is intended to be extended by the user in order to create an instrument-level strategy with name InstrumentProcessor
.
When running your strategy, Botmain will create an instance your InstrumentProcessor
for every instrument included in the run. Botmain exposes properties, methods, and events to use when building automated strategies.
Properties
Name | Type | Description |
---|---|---|
bars |
| Provides access to intraday bars data |
currentPrice | number | Current price of instrument |
currentTime | Date | Current experiment time |
daily |
| Provides access to daily bars data |
dayClose | number | Close price of the day. If intraday or tick subscriptions exist, this property is updated automatically during the day from the last intraday bar close or from the last trade. |
dayHigh | number | Highest price of the day. If intraday or tick subscriptions exist, this property is updated automatically during the day from the intraday bar highs or from trades. |
dayLow | number | Lowest price of the day. If intraday or tick subscriptions exist, this property is updated automatically during the day from the intraday bar lows or from trades. |
dayOpen | number | Today’s open price. If a daily subscription exists, this property is taken from today daily open price. If no daily subscription exists, this property is taken from the first intraday bar open or from the first trade. |
exchange |
| The instrument exchange |
fundamentals |
| Provides access to fundamental data |
isActive | boolean | Active state for the instrument. Used to determine whether an instrument is currently trading on its exchange |
market |
| The instrument market |
portfolioProcessor |
| Reference to your custom PortfolioProcessorBase instance. If you need access to your customer |
priceChangeOpen | number | The difference between the current price and today’s open price. |
priceChangeOpenPct | number | The percentage ratio between the daily price change compared to the today's open price. |
priceChangeYClose | number | The difference between the current price and yesterday’s close price. |
priceChangeYClosePct | number | The percentage ratio between the daily price change compared to yesterday’s close. |
quotes |
| Provides access to tick data |
simulationMode |
| The order execution simulation mode |
volume | number | Current trading volume of the instrument. If an intraday or tick subscriptions exist, this property is updated automatically during the day from intraday bar volumes or from trade sizes. |
yClose | number | Yesterday's close price. If a daily subscription exists, this property is taken from the previous day close. If no daily subscription exists, this property is taken from the last intraday bar close or from the last trade. |
Methods
getBarsHistory() | |||||||||
---|---|---|---|---|---|---|---|---|---|
Get historical data from the strategy stack. | |||||||||
Presentation
| |||||||||
Parameters
Returns
|
getDailyHistory() | |||||||||
---|---|---|---|---|---|---|---|---|---|
Get historical end-of-day data from the strategy stack. | |||||||||
Presentation
| |||||||||
Parameters
Returns
|