Tick Imbalance Bars
- Indicadores
- Henrique Helmuth Kreutz Pfeifer
- Versão: 1.1
- Atualizado: 29 março 2022
Tick imbalance bars (TIB), descrito no livro Advances in Financial Machine Learning (2018) de Marcos López de Prado.
Indicador que forma barras (candlesticks) com uma amostragem diferente da fixa por tempo.
Utiliza dados em tempo real e pode ser usado como substituto do gráfico padrão.
Cada barra é formada quando um certo equilíbrio é ultrapassado, devolvendo ao usuário os valores OHLC do agrupamento.
O parâmetro de entrada tick_threshold é o balanço esperado de uma barra. Quando excedido, uma nova barra se inicia e o balanço é zerado.
O indicador pode não funcionar corretamente no testador de estratégias. O Metatrader agrupa os ticks por preço. Quando o preço se repete, o balanço passado também se repete e isso é determinante para a amostragem das barras. Se os ticks são agrupados, o balanço anterior não se repete e afeta a amostragem.
Estão disponíveis dois buffers auxiliares: stdev_log_returns (buffer 5) e new_bar (buffer 6). Eles indicam o desvio padrão da taxa de retorno logarítmica e se o tick atual indica o início de uma nova barra (1 para sim, 0 para não).
Ps.: como discutido nessa issue, existe um problema com o gatilho das TIB. A abordagem escolhida para eliminar o problema foi limitar a expectativa máxima no valor determinado como tick_threshold, desde o início da formação da primeira barra.