This recipe demonstrates the initial coding of the StrategyMACDBracketOrder class. The complete class will be coded by the end of the eleventh recipe of this chapter. In this recipe, you will code the following methods:
- __init__()
- initialize()
- name()
- versions_supported()
To learn more about the MACD technical indicator, please refer to the Trend indicator – moving average convergence divergence recipe of Chapter 5, Computing and Plotting Technical Indicators.
Please refer to the flowchart in the introduction of this chapter to understand how the AlgoBulls core engine calls the __init__() and initialize() methods during strategy execution.
Getting ready
Make sure you have the StrategyBase and pyalgotrading constants in your Python namespace. Refer to the Technical requirements section of this chapter to set it up.
How to do it…
Create a new class named StrategyMACDBracketOrder...