本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
// Heikin Ashi Candle Colour Change Alerts
// Description: This script allows you to set alerts for Heikin Ashi up and down candles. For example, you may wish to exit a trade when the first down candle is printed after a sequence of up candles.
// Written by: @crypto_bing
study("Heikin Ashi Candle Colour Change Alerts", overlay=true)
val = (open + high + low + close) / 4
up = val > val[1]
down = val <= val[1]
alertcondition(condition = up, title = 'Up Candle', message = ' - UP CANDLE')
alertcondition(condition = down, title = 'Down Candle', message = ' - DOWN CANDLE')
plotshape(up, title = 'Up Candle', style = shape.square, color = lime, location = location.bottom)
plotshape(down, title = 'Down Candle', style = shape.square, color = red, location = location.bottom)