Tradingview Stochasti c Стратегия кроссовера - PullRequest
0 голосов
/ 19 января 2020

Я хочу купить, когда schochasti c% K% D пересекает линию ниже 65, и хочу продавать, когда она пересекает в разделе прибыли

Любая помощь с благодарностью

strategy(title = "stoch crossover under")

Stochlength = input(14, minval=1, title="lookback length of Stochastic")
StochOverBought = input(80, title="Stochastic overbought condition")
StochOverSold = input(60, title="Stochastic oversold condition")
smoothK = input(3, title="smoothing of Stochastic %K ")
smoothD = input(3, title="moving average of Stochastic %K")
k = sma(stoch(close, high, low, Stochlength), smoothK)
d = sma(k, smoothD)


 if (crossover(k,d) and k < StochOverSold)
        strategy.entry("long", strategy.long)
    if (crossunder(k,d))
        strategy.entry("short", strategy.short)
...