Open-High Cross Over Trading Strategy
Overview
This strategy generates trading signals based on the crossover between open and high prices. It goes long when open price crosses above high price and goes short when open price crosses below high price. Moving averages can be used to smooth the price data and reduce noisy trades. Various types and parameters of moving averages are configurable. Trailing stop loss can also be enabled to lock in profits.
Strategy Logic
-
Determine whether to use an alternate resolution based on the input parameter useRes. If enabled, set the resolution with stratRes.
-
Decide whether to use moving average (useMA) based on input parameter. If enabled, select MA type with basisType and set period length with basisLen.
-
Get open price (open) and close price (close) series data. Apply selected MA with configured parameters if useMA enabled.
-
Compare current open price x with open series openSeries. If x is greater than openSeries, set trendState to long, otherwise to short.
-
Generate long signal longCond when open price crosses above open MA series. Generate short signal shortCond when open price crosses below open MA series.
-
Enter long or short positions based on long and short signals. Set stop loss points and offset if trailing stop loss is enabled.
Advantages
-
Uses two different price series, open and high, avoiding limitations of single series.
-
MA techniques filter out short-term noise and focus on major trend.
-
Flexible configuration of MA types and parameters for optimal effect.
-
Optional trailing stop loss to control risk and lock in profits.
-
High optimization space to adjust parameters for different products and market environments.
Risks
-
Single signal source leads to scarce signals and potentially missed trades.
-
MA lag may result in missing short-term opportunities.
-
Improper stop loss configuration could lead to premature exit or excess loss.
-
Poor parameter tuning could cause excessive fictional trades affecting live performance.
-
Parameter optimization is challenging for different products and environments.
-
Add more indicators or ML models to enrich signal sources. Fine tune MA types and parameters. Set stop loss carefully with some buffer to capture more profit. Thoroughly backtest and optimize parameters.
Optimization Directions
-
Incorporate additional indicators like Bollinger Bands, KD etc. to expand signal sources.
-
Apply machine learning models for signal generation.
-
Optimize MA parameters to find best configurations.
-
Balance stop loss levels between risk and profit capture.
-
Add parameter optimization methods to auto find optimal settings.
-
Develop specialized parameter templates for different products.
-
Build quantitative backtesting frameworks for quick strategy iterations.
Summary
This strategy generates signals based on open-high crossovers and uses MAs to filter noise. It offers flexibility through configurable parameters. The strategy has advantages but also some problems like sparse signals and lag. Further improvements can be made through more indicators, machine learning models etc. Extensive parameter tuning and optimization is needed for the best performance across different products and market environments.
/*backtest
start: 2022-10-17 00:00:00
end: 2023-10-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
//strategy(title = "Open Close Cross Strategy", shorttitle = "OCC Strategy", overlay = true, pyramiding = 0, default_qty_type = strategy.percent_of_equity, default_qty_value = 10)
- 1

