请帮助我使用 pinescript 中的以下代码

Please help me with the following code in pinescript

如何让下面的代码工作?

//@version=3

strategy("My Strategy", overlay=true)

longCondition = crossover(ema(close, 13), vwap) and crossover(ADX, DIMinus) and crossover(MACD, MACDSignal)

if (longCondition)
    strategy.entry("My Long Entry Id", strategy.long)

shortCondition = crossunder(ema(close, 13), vwap) and crossover(ADX, DIPLUS) and crossover(MACDSignal, MACD)
if (shortCondition)
    strategy.entry("My Short Entry Id", strategy.short)

我不知道其中有多少变量,但下面的代码是我根据所提供变量的名称建议的。它们类似于定向运动指标和 MACD 指标值的输出。使用此代码作为示例来构建您自己的代码。

//@version=3
strategy("My Strategy", overlay=true)
len = input(14, minval=1, title="DI Length")
lensig = input(14, title="ADX Smoothing", minval=1, maxval=50)

up = change(high)
down = -change(low)
DIPLUS = na(up) ? na : (up > down and up > 0 ? up : 0)
DIMinus = na(down) ? na : (down > up and down > 0 ? down : 0)
trur = rma(tr, len)
plus = fixnan(100 * rma(DIPLUS, len) / trur)
minus = fixnan(100 * rma(DIMinus, len) / trur)
sum = plus + minus
ADX = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

[MACD, MACDSignal, histLine] = macd(close, 12, 26, 9)


longCondition = crossover(ema(close, 13), vwap) and crossover(ADX, DIMinus) and crossover(MACD, MACDSignal)

if (longCondition)
    strategy.entry("My Long Entry Id", strategy.long)

shortCondition = crossunder(ema(close, 13), vwap) and crossover(ADX, DIPLUS) and crossover(MACDSignal, MACD)
if (shortCondition)
    strategy.entry("My Short Entry Id", strategy.short)