Generation 6

MtxTrader · strategy · 10 行 · 点赞 363 · TradingView 原页

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

Pine Script

//@version=2
strategy("Generation 6", overlay=true, commission_value = 0.02, initial_capital = 10000, pyramiding = 1)
 
// Initial Trend Establishment Trades
 
longcondition = sma(close, 15) > sma(close, 60) and crossover(sma(close, 20), ema(close, 60)) and close > sma(close, 600)
shortcondition = sma(close, 15) < sma(close, 60) and crossunder(sma(close, 20), ema(close, 60)) and close < sma(close, 600)
 
strategy.entry("buy", strategy.long, 1, when = longcondition)
strategy.entry("sell", strategy.short, 1, when = shortcondition)

← 返回列表