
A estratégia é uma estratégia conjunta que combina a estratégia de reversão de tendência e a estratégia de volatilidade estatística para obter um sinal de negociação mais forte.
A estratégia consiste em duas partes:
Estratégia de reversão de tendência
Estratégia de flutuação estatística
Finalmente, se os dois sinais de estratégia coincidirem, ou seja, se estiverem em alta ou baixa, um sinal de negociação será produzido; se não estiverem em alta, não haverá negociação.
A estratégia combina dois tipos diferentes de estratégias para aumentar a confiabilidade do sinal.
A análise da forma 123 permite capturar com precisão os pontos de reversão da tendência, evitando ser enganado por mudanças bruscas nos preços.
A taxa de flutuação estatística reflete a volatilidade do mercado nos últimos meses, permitindo filtrar os períodos de maior volatilidade e maior oportunidade de negociação.
As duas estratégias são mutuamente verificáveis e, em combinação, utilizam uma melhor captação dos pontos de inflexão do mercado, resultando em sinais de negociação mais precisos e confiáveis.
A forma 123 não pode evitar completamente o risco de falha. Se houver uma vibração anormal, o sinal pode ser mal interpretado.
A taxa de flutuação estatística considera apenas dados históricos e não pode prever tendências futuras de flutuação. Se a flutuação do mercado aumentar ou contrair de repente, também é fácil gerar sinais errados.
Ambas as estratégias dependem da otimização de parâmetros. Se os parâmetros forem mal definidos, a qualidade do sinal será fortemente reduzida.
Embora a estratégia conjunta tenha aumentado a confiabilidade, ela pode ter perdido alguns dos sinais mais fortes.
O sistema de votação é composto por mais indicadores, como o Brin, o KDJ e outros.
Aumentar os algoritmos de aprendizagem de máquina para determinar a probabilidade de uma reversão de tendência com mais dados históricos.
Configure um sinal de filtragem forte e fraco para evitar interferência de ruído.
Optimizar a configuração dos parâmetros, ajustando os parâmetros para diferentes variedades e períodos.
Aumentar o mecanismo de stop loss para controlar os riscos da estratégia conjunta.
A estratégia, através da aplicação conjunta de estratégias de reversão de tendências e estratégias de volatilidade estatística, aumenta a qualidade do sinal e pode dar instruções de negociação mais precisas em pontos de inflexão críticos do mercado. Mas também precisa ter em conta o risco de erro de julgamento e a otimização de parâmetros. Combinando mais indicadores e meios de aprendizado de máquina para otimização adicional, pode-se obter uma negociação mais estável e confiável.
/*backtest
start: 2023-09-23 00:00:00
end: 2023-10-23 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 31/07/2021
// 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
// This indicator used to calculate the statistical volatility, sometime
// called historical volatility, based on the Extreme Value Method.
// Please use this link to get more information about Volatility.
//
// 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
SV(Length,TopBand,LowBand) =>
pos = 0.0
xMaxC = highest(close, Length)
xMaxH = highest(high, Length)
xMinC = lowest(close, Length)
xMinL = lowest(low, Length)
SqrTime = sqrt(253 / Length)
Vol = ((0.6 * log(xMaxC / xMinC) * SqrTime) + (0.6 * log(xMaxH / xMinL) * SqrTime)) * 0.5
nRes = iff(Vol < 0, 0, iff(Vol > 2.99, 2.99, Vol))
pos := iff(nRes > TopBand, 1,
iff(nRes < LowBand, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & Statistical Volatility", shorttitle="Combo", overlay = true)
line1 = input(true, "---- 123 Reversal ----")
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
line2 = input(true, "---- Statistical Volatility ----")
LengthSV = input(30, minval=1)
TopBand = input(0.005, step=0.001)
LowBand = input(0.0016, step=0.001)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posSV = SV(LengthSV,TopBand,LowBand)
pos = iff(posReversal123 == 1 and posSV == 1 , 1,
iff(posReversal123 == -1 and posSV == -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 )