0
tập trung vào
0
Người theo dõi

Xin hãy giúp tôi, làm thế nào tôi có thể triển khai chu kỳ đặt hàng trong chiến lược ngôn ngữ thông? Bây giờ tôi chỉ có thể đặt một đơn hàng nhưng không theo dõi

Được tạo ra trong: 2022-11-14 10:11:47, cập nhật trên:
comments   7
hits   990

//@version=4 strategy(title=“EMA crosses”, overlay=true)

// Inputs priceData = input(title=“Price data”, type=input.source, defval=hl2) ema1Length = input(title=“EMA 1”, type=input.integer, defval=12) ema2Length = input(title=“EMA 2”, type=input.integer, defval=24) ema3Length = input(title=“EMA 3”, type=input.integer, defval=36)

// Compute values ema1 = ta.ema(priceData, ema1Length) ema2 = ta.ema(priceData, ema2Length) ema3 = ta.ema(priceData, ema3Length)

enterLong = ema1 > ema2 and ema2 > ema3 enterShort = ema1 < ema2 and ema2 < ema3

// Plot values plot(series=ema1, color=color.orange, linewidth=2) plot(series=ema2, color=color.maroon, linewidth=2) plot(series=ema3, color=color.blue, linewidth=2)

// Submit orders if (enterLong) strategy.entry(id=“Enter Long”, long=strategy.long)

if (enterShort) strategy.entry(id=“Enter Short”, long=strategy.short)

Hiện tại, trong quá trình thử nghiệm, một lệnh sẽ được đặt ở đầu tiên, và các lệnh khác dường như không được kích hoạt, có một ông chủ nào có thể hướng dẫn cách thực hiện vòng quay chiến lược không, cảm ơn.