Implement the On-Balance Volume (OBV) trading strategy using the existing volume.Obv indicator.
Location: strategy/volume/obv_strategy.go
Strategy Rules:
- Buy Action: OBV crosses above its 10-period SMA (Simple Moving Average).
- Sell Action: OBV crosses below its 10-period SMA.
- Hold Action: Otherwise.
Implementation Details:
- Follow the
strategy.Strategy interface.
- Use
volume.NewObv() and trend.NewSmaWithPeriod(10) to calculate signals.
- Provide unit tests with historical data in
strategy/volume/testdata/obv_strategy.csv.
- Ensure 100% test coverage.
Implement the On-Balance Volume (OBV) trading strategy using the existing
volume.Obvindicator.Location:
strategy/volume/obv_strategy.goStrategy Rules:
Implementation Details:
strategy.Strategyinterface.volume.NewObv()andtrend.NewSmaWithPeriod(10)to calculate signals.strategy/volume/testdata/obv_strategy.csv.