简体   繁体   English

如何使用 pine-script 在 TradingView 中编写多时间框架策略?

[英]How to code a multiple timeframe strategy in TradingView with pine-script?

I am trying to code and implement a strategy based on multiple timeframes.我正在尝试基于多个时间框架编写和实施策略。 The logic is simple as follows -逻辑很简单如下 -

Condition 1 = Stochastic K & D both Oversold (or Overbought) on both 15 Minutes and 30 Minutes timeframes Condition 2 = K > D (or K < D)条件 1 = 随机 K 和 D 在 15 分钟和 30 分钟时间范围内均超卖(或超买)条件 2 = K > D(或 K < D)

Enter Long (or Enter Short)输入长(或输入短)

How can I code this in TradingView with pine script?如何使用 pine 脚本在 TradingView 中对此进行编码?

You should use the security() function for this purpose.为此,您应该使用security() function。

The following code will request SMA9 from the daily timeframe.以下代码将从每日时间范围内请求SMA9

//@version=4
study(title="High Time Frame MA", overlay=true)
src = close, len = 9
out = sma(src, len)
out1 = security(syminfo.tickerid, 'D', out)
plot(out1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM