Stratégie de négociation combinée à inversion multi-indicateurs

Auteur:ChaoZhang est là., Date: 2023-09-13 15:04:40 Je vous en prie.
Les étiquettes:

Cette stratégie s'appelle Multi-indicator Combined Reversal Trading Strategy. Elle intègre divers indicateurs techniques pour identifier les opportunités d'inversions de prix à court terme et le commerce contre la tendance précédente pour les bénéfices.

Premièrement, la stratégie utilise le modèle de renversement 123 pour déterminer les renversements de tendance à court terme. Le modèle 123 est lorsque les prix s'écartent significativement sur trois jours consécutifs et que le troisième jour se ferme dans la direction opposée aux deux jours précédents. Statistiquement, le trading avec des signaux de renversement 123 a un taux de gain plus élevé.

Deuxièmement, l'indicateur RSI est incorporé pour évaluer la fiabilité des signaux d'inversion.

Troisièmement, l'indicateur de l'OCM est introduit. L'indicateur de l'OCM combinant différentes moyennes mobiles exponentielles de période évalue les renversements de dynamique. Ses signaux confirment davantage le moment de l'inversion.

L'application combinée de plusieurs indicateurs augmente le taux de réussite de la capture des renversements de prix en évitant des signaux d'incertitude excessifs.

Cette stratégie s'adapte aux marchés oscillants pour capturer les fluctuations de prix à court terme. Cependant, la combinaison de trop d'indicateurs peut également entraîner des conflits. L'optimisation des paramètres est nécessaire.

En conclusion, la stratégie de trading de renversement combinée à plusieurs indicateurs intègre divers outils pour améliorer la précision du jugement des renversements de marché.


/*backtest
start: 2023-01-01 00:00:00
end: 2023-03-11 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 25/02/2020
// This is combo strategies for get a cumulative signal. 
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The 
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close 
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
// The strategy sells at market, if close price is lower than the previous close price 
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
// The related CMOaDisparity Index article is copyrighted material from Stocks & Commodities Dec 2009
// My strategy modification.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
    vFast = sma(stoch(close, high, low, Length), KSmoothing) 
    vSlow = sma(vFast, DLength)
    pos = 0.0
    pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
	         iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0))) 
	pos

CMOD(LengthFirst, LengthSecond, LengthThird) =>
    pos = 0.0
    xEMAFirst = ema(close,LengthFirst)
    xEMASecond  = ema(close,LengthSecond)
    xEMAThird  = ema(close,LengthThird)
    xResFirst = 100 * (close - xEMAFirst) / close
    xResSecond = 100 * (close - xEMASecond) / close
    xResThird = 100 * (close - xEMAThird) / close
    pos := iff(xResThird > xResFirst, -1,
             iff(xResThird < xResSecond, 1, nz(pos[1], 0)))     
    pos

strategy(title="Combo Backtest 123 Reversal & CMOaDisparity Index", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthFirst = input(50, minval=1)
LengthSecond = input(25, minval=1)
LengthThird = input(10, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOD = CMOD(LengthFirst, LengthSecond, LengthThird)
pos = iff(posReversal123 == 1 and posCMOD == 1 , 1,
	   iff(posReversal123 == -1 and posCMOD == -1, -1, 0)) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1 , 1, pos))	   
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	 
if (possig == 0) 
    strategy.close_all()
barcolor(possig == -1 ? #b50404: possig == 1 ? #079605 : #0536b3 )

Plus de