ALGORITHM.md
March 1, 2019 · View on GitHub
Classes
Backtest
Incomplete
backtest.run(minute) ⇒ Promise.<Object>
Runs a backtest on the given algorithm.
Kind: instance method of Backtest
| Param |
|---|
| minute |
Scheduler
Used to run functions at specified intervals or times of day.
Kind: global class
- Scheduler
- new Scheduler(f)
- .onMarketOpen(offset) ⇒
Promise.<Date> - .onMarketClose(offset) ⇒
Promise.<schedule> - .every(minutes, extended)
- .cancel()
- .getNext() ⇒
Date|Error
new Scheduler(f)
Creates a new scheduled task
| Param | Type |
|---|---|
| f | function |
scheduler.onMarketOpen(offset) ⇒ Promise.<Date>
Runs every day on market open.
Kind: instance method of Scheduler
Returns: Promise.<Date> - - Date object of next invocation.
Author: Torrey Leonard https://github.com/Ladinn
| Param | Type | Description |
|---|---|---|
| offset | Number | The offset, in milliseconds, from market open to run the algorithm. Negative is before, positive is after. |
scheduler.onMarketClose(offset) ⇒ Promise.<schedule>
Runs every day on market close.
Kind: instance method of Scheduler
Author: Torrey Leonard https://github.com/Ladinn
| Param | Type | Description |
|---|---|---|
| offset | Number | The offset, in milliseconds, from market close to run the algorithm. Negative is before, positive is after. |
scheduler.every(minutes, extended)
Runs every 'x' minutes while the market is open.
Kind: instance method of Scheduler
Author: Torrey Leonard https://github.com/Ladinn
| Param | Type | Description |
|---|---|---|
| minutes | Number | |
| extended | Boolean | Whether to run during extended trading hours. |
scheduler.cancel()
Cancels a job.
Kind: instance method of Scheduler
Author: Torrey Leonard https://github.com/Ladinn
scheduler.getNext() ⇒ Date | Error
Returns the date of the next invocation of the given job.
Kind: instance method of Scheduler
Author: Torrey Leonard https://github.com/Ladinn