Type/to search

Oscillator Candles Momentum Trading Strategy

Cryptocurrency
Created: 2023-09-26 20:05:55
Last modified: 3 years ago
1
Follow
1781
Followers

Overview

This is a momentum-based strategy that uses oscillators indicators like RSI, Stoch, MACD to generate trading signals. The main idea is to identify trend direction when price oscillates by using indicators and enter trades based on indicator signals. The strategy also uses delayed supertrend for stop loss.

Strategy Logic

The strategy first calls custom function f_getOscilatorValues to get values of different oscillator indicators including RSI, Stoch, MACD etc. Then it calculates delayed supertrend values with f_getSupertrend to track stop loss.

After calculating the indicators, the strategy calls f_getBuySellStops to compute entry stops and profit targets based on indicator values. Specifically, it calculates ATR and uses ATR multiplied by a stop loss coefficient as entry stop, and ATR multiplied by a take profit coefficient as profit target. The stops and targets will adjust when trend reverses.

Next, the strategy determines the candle direction. Uptrend candles are colored green and downtrend candles are colored red. After plotting candles and indicators, the strategy checks if entry conditions are met. The entry conditions are buying when indicator shows overbought and price breaks above upper band, and selling when indicator shows oversold and price breaks below lower band. There is also a filtering condition requiring price to break higher timeframe moving average.

After entry, stop loss is trailed by upper/lower band whichever is closer. When stop loss is triggered, the position is closed. When price reaches profit target, partial profit is taken.

Advantage Analysis

The advantages of this strategy are:

  1. Using oscillators to identify trend direction can capture short-term reversal opportunities timely.

  2. Applying delayed supertrend stop loss can stop out before loss increases, limiting single trade loss.

  3. Calculating stop loss and profit target based on dynamic ATR helps adjust position sizing.

  4. Filtering with higher timeframe moving average avoids being trapped in consolidations.

  5. Partial profit taking lets profits run while locking some profit.

  6. The logic is simple and easy to understand for quant trading beginners.

Risk Analysis

Some risks of this strategy include:

  1. Oscillators may have lagging issues, causing delayed entry and premature exit signals. This can be improved by optimizing parameters or adding trend following indicators.

  2. Tight stop loss may get hit. Stop loss range could be widened or dynamic stops like Chandelier can be used.

  3. Remaining position after partial profit taking may be stopped out. The partial profit ratio could be lowered.

  4. Backtest overfitting risk. The strategy should be validated across different markets.

  5. Failure of higher timeframe moving average filter. Trend classification methods should be used together.

Enhancement Directions

The strategy can be optimized in the following aspects:

  1. Test different combinations of oscillators parameters and find the ones that provide quality signals.

  2. Try replacing partial profit taking with trailing profit stop based on ATR or moving averages.

  3. Add machine learning algorithms to replace moving average for trend analysis and improve accuracy.

  4. Add volume indicators as filtering conditions to avoid unnecessary reversals.

  5. Ensemble and weight optimize indicators to find the optimal combination for the asset.

  6. Add machine learning risk control modules to dynamically optimize stops, targets and position sizing.

  7. Incorporate triangular arbitrage or basis trading signals using price spreads between futures and spot.

Conclusion

Overall this is a great strategy for quant trading beginners with clear logic focusing on indicators and risk management. But parameter optimization and risk reduction are still needed for live trading. It can also be enhanced in aspects like trend analysis, stop loss optimization, ensemble models etc to improve robustness. As a trading strategy template, it provides valuable reference.

Source
Pine
/*backtest
start: 2023-08-26 00:00:00
end: 2023-09-25 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © HeWhoMustNotBeNamed

//@version=4
Strategy parameters
Strategy parameters
Oscliator Type
length
shortlength
longlength
showSupertrend
Moving Average Type
AtrLength
stopMultiplier
targetMultiplier
wicks
considerWicksForDelayByStep
colorByPreviousClose
useHTFPivot
resolution
Higher Timeframe multiplier (Used when resolution is set to Same as Symbol)
PivotLength
Trade Direction
Backtest Start Time
Backtest End Time
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)