Ichimoku Kinko Hyo Mean Reversão Estratégia

Autora:ChaoZhang, Data: 2023-09-24 13:11:38
Tags:

Resumo

Esta estratégia integra o indicador Ichimoku Kinko Hyo, o breakout diário, a média móvel suavizada de Gauss, o MACD e outros indicadores técnicos para determinar a direção da tendência e encontrar pontos de entrada confiáveis.

Estratégia lógica

  1. Julgamento de Ichimoku Kinko Hyo: Cruzamento da Linha de Conversão acima da Linha de Base é sinal de alta.

  2. Julgamento de ruptura diária: fechamento de hoje mais alto do que ontem fechamento por um certo limiar confirma alta.

  3. Julgamento de MA suavizado por Gauss: O cruzamento de preços acima de MA é otimista.

  4. Julgamento MACD: Crossover DIFF acima DEA é otimista.

  5. Combinar os fatores acima para determinar a mudança de tendência e o ponto de entrada.

Vantagens

  1. Indicadores múltiplos melhoram a precisão.

  2. As confirmações intradiárias e multi-temporárias evitam falhas.

  3. Ichimoku Kinko Hyo determina a tendência de forma confiável.

  4. A MA suavizada gaussiana tem um pequeno atraso.

  5. O MACD julga a mudança de momento.

Riscos

  1. Múltiplas condições simultâneas reduzem a possibilidade de entradas.

  2. Os parâmetros errados do indicador podem gerar sinais errados.

  3. Os sinais intradiários e os sinais multi-tempo podem entrar em conflito.

  4. Falsas fugas ainda ocorrem, incorrendo em perdas.

Possíveis soluções:

  1. Ajuste os parâmetros para aumentar as entradas.

  2. Otimizar parâmetros para diferentes produtos e prazos.

  3. Coordenar sinais de diferentes prazos.

  4. Usar stop loss para limitar perdas.

Orientações de otimização

  1. Teste diferentes combinações de indicadores para melhores sinais.

  2. Adicionar aprendizado de máquina para melhorar julgamentos a partir de mais dados.

  3. Adicionar a detecção de tendências para evitar transações contra-tendências.

  4. Otimizar a gestão do dinheiro para a robustez.

  5. Otimizar o stop loss e tirar lucro para rentabilidade.

Resumo

Esta estratégia integra múltiplos indicadores para determinar a direção da tendência, e entra em sinais de alta probabilidade de alta verificados em diferentes prazos e indicadores.


/*backtest
start: 2022-09-17 00:00:00
end: 2023-09-23 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
// Any timeFrame ok but good on 15 minute & 60 minute , Ichimoku + Daily-Candle_cross(DT) + HULL-MA_cross + MacD combination 420 special blend
strategy("Ichimoku + Daily-Candle_X + HULL-MA_X + MacD", shorttitle="٩(̾●̮̮̃̾•̃̾)۶", overlay=true, default_qty_type=strategy.percent_of_equity, max_bars_back=26, default_qty_value=100, calc_on_order_fills= true, calc_on_every_tick=true, pyramiding=0,precision=6)
keh=input(title="Double HullMA",defval=14, minval=1)
dt = input(defval=0.0010, title="Decision Threshold (0.001)", type=float, step=0.0001)
SL = input(defval=-500.00, title="Stop Loss in $", type=float, step=1)
TP = input(defval=25000.00, title="Target Point in $", type=float, step=1)
ot=1
p = input(7, minval=1, title="Length")
pi=3.1415926535
w=2*pi/p
beta = (1 - cos(w))/(pow(1.414,2.0/3) - 1)
alfa = -beta + sqrt(beta*beta + 2*beta)
ret1= pow(alfa,4)*close+4*(1-alfa)*nz(ret1[1])-6*pow(1-alfa,2)*nz(ret1[2])+4*pow(1-alfa,3)*nz(ret1[3])-pow(1-alfa,4)*nz(ret1[4])
ret2= pow(alfa,4)*close[1]+4*(1-alfa)*nz(ret1[1])-6*pow(1-alfa,2)*nz(ret1[2])+4*pow(1-alfa,3)*nz(ret1[3])-pow(1-alfa,4)*nz(ret1[4])
confidence=(security(syminfo.tickerid, 'D', close)-security(syminfo.tickerid, 'D', close[1]))/security(syminfo.tickerid, 'D', close[1])
conversionPeriods = input(9, minval=1, title="Conversion Line Periods")
basePeriods = input(26, minval=1, title="Base Line Periods")
laggingSpan2Periods = input(52, minval=1, title="Lagging Span 2 Periods")
displacement = input(26, minval=1, title="Displacement")
donchian(len) => avg(lowest(len), highest(len))
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)
LS=close, offset = -displacement
MACD_Length = input(9)
MACD_fastLength = input(12)
MACD_slowLength = input(26)
MACD = ema(close, MACD_fastLength) - ema(close, MACD_slowLength)
aMACD = ema(MACD, MACD_Length)
closelong = ret1<ret2 and close<ret2 and confidence<dt or strategy.openprofit<SL or strategy.openprofit>TP
if (closelong)
    strategy.close("Long")
longCondition = ret1>ret2 and strategy.opentrades<ot and confidence>dt and close>ret2 and leadLine1>leadLine2 and open<LS and MACD>aMACD
if (longCondition)
    strategy.entry("Long",strategy.long)
//                         /L'-, 
//                               ,'-.           /MM . .             /  L '-, 
//     .                    _,--dMMMM\         /MMM  `..           /       '-, 
//     :             _,--,  )MMMMMMMMM),.      `QMM   ,<>         /_      '-,' 
//     ;     ___,--. \MM(    `-'   )M//MM\       `  ,',.;      .-'* ;     .' 
//     |     \MMMMMM) \MM\       ,dM//MMM/     ___ < ,; `.      )`--'    / 
//     |      \MM()M   MMM)__   /MM(/MP'  ___, \  \ `  `. `.   /__,    ,' 
//     |       MMMM/   MMMMMM( /MMMMP'__, \     | /      `. `-,_\     / 
//     |       MM     /MMM---' `--'_ \     |-'  |/         `./ .\----.___ 
//     |      /MM'   `--' __,-  \""   |-'  |_,               `.__) . .F. )-. 
//     |     `--'       \   \    |-'  |_,     _,-/            J . . . J-'-. `-., 
//     |         __  \`. |   |   |         \    / _           |. . . . \   `-.  F 
//     |   ___  /  \  | `|   '      __  \   |  /-'            F . . . . \     '` 
//     |   \  \ \  /  |        __  /  \  |  |,-'        __,- J . . . . . \ 
//     |    | /  |/     __,-  \  ) \  /  |_,-     __,--'     |. .__.----,' 
//     |    |/    ___     \    |'.  |/      __,--'           `.-;;;;;;;;;\ 
//     |     ___  \  \     |   |  `   __,--'                  /;;;;;;;;;;;;. 
//     |     \  \  |-'\    '    __,--'                       /;;;;;;;;;;;;;;\ 
// \   |      | /  |      __,--'                             `--;;/     \;-'\ 
//  \  |      |/    __,--'                                   /  /         \  \ 
//   \ |      __,--'                                        /  /           \  \ 
//    \|__,--'                                          _,-;M-K,           ,;-;\ 
//                                                     <;;;;;;;;           '-;;;; 
//a1=plot(n1,color=c)
//a2=plot(n2,color=c)
//plot(cross(n1, n2) ? n1 : na, style = circles, color=b, linewidth = 4)
//plot(cross(n1, n2) ? n1 : na, style = line, color=d, linewidth = 4)
//plot(conversionLine, color=#0496ff, title="Conversion Line")
//plot(baseLine, color=#991515, title="Base Line")
//plot(close, offset = -displacement, color=#459915, title="Lagging Span")
//p1=plot (leadLine1, offset = displacement, color=green,  title="Lead 1")
//p2=plot (leadLine2, offset = displacement, color=red,  title="Lead 2")
//fill(p1, p2, color = leadLine1 > leadLine2 ? green : red)
// remove the "//" from before the plot script if want to see the indicators on chart

Mais.