Turtle Trade Channels

KivancOzbilgic · study · 15 行 · 点赞 2,621 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

//@version=2
//author:KıvanÇ @fr3762
study("Turtle Trade Channels", shorttitle="TTC", overlay=true)
len1=input(20, "long length")
len2=input(10, "short length")
up=highest(high,len1)
down=lowest(low,len1)
sup=highest(high,len2)
sdown=lowest(low,len2)
K1=iff(barssince(close>up[1])<=barssince(close<down[1]),down,up)
K2=iff(barssince(close>up[1])<=barssince(close<down[1]),sdown,sup)
K3=iff(close>K1,down,na)
K4=iff(close<K1,up,na)
plot(K1, title="Trade Signal", color=red, linewidth=3, style=2)
plot(K2, title="Exit Line", color=blue, linewidth=2, style=6)

← 返回列表