-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersp2High Priority (priority 2)High Priority (priority 2)
Description
Add User-Defined Functions
Motivation
Users should be able to express behavior at the beginning of a backtest and at the end of a backtest. The default, of course, is that nothing special happens after a backtest starts or stops running. But what if a user wants to set some context variables before the backtest begins running? Or what if they want to make a graph after the backtest stops running, but they don't want to perform that behavior throughout the backtest?
Current Code
Solution
- Add functions called
onbeginandonendtoStrategyOptions. These functions should take the standard user-defined function arguments. As of the time of writing, this would include onlystrat. Depending - Invoke
onbeginhere: https://github.com/maxholloway/backtest/blob/ab8e7db4dfb67a000b3cf387d1c94297aedfd04e/src/Backtest.jl#L386 - Invoke
onendhere, replacing the currentlogstatement: https://github.com/maxholloway/backtest/blob/ab8e7db4dfb67a000b3cf387d1c94297aedfd04e/src/Backtest.jl#L398
Status: Blocked until we implement context passing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersp2High Priority (priority 2)High Priority (priority 2)