binance webhook 信号冲突

问题描述 投票:0回答:1
// Uzun giriş
if (longEntry and canOpenLong)
    strategy.close("Short")
    strategy.entry("Long", strategy.long)
    canOpenLong := false
    canOpenShort := true
    

// Kısa giriş
if (shortEntry and canOpenShort) 
    strategy.close("Long")
    strategy.entry("Short", strategy.short)
    canOpenShort := false
    canOpenLong := true     

多头平仓和空头信号同时出现,币安正在制造其中之一。我该如何修复它

tradingview-api binance
1个回答
0
投票
var bool canOpenShort = true

var bool longClosed = false
var bool shortClosed = false

// Uzun giriş
if (longEntry and canOpenLong and not longClosed)
   strategy.entry("Long", strategy.long)
   canOpenLong := false
   canOpenShort := true
   longClosed := true

// Uzun çıkış
if (not longEntry and longClosed)
   strategy.close("Long")
   longClosed := false
   canOpenLong := true

// Kısa giriş
if (shortEntry and canOpenShort and not shortClosed) 
   strategy.entry("Short", strategy.short)
   canOpenShort := false
   canOpenLong := true
   shortClosed := true

// Kısa çıkış
if (not shortEntry and shortClosed)
   strategy.close("Short")
   shortClosed := false
   canOpenShort := true

我修复它

© www.soinside.com 2019 - 2024. All rights reserved.