Fehlermeldungen:
- variableType.itemType is not a function
- Undeclared identifier '_ticker';
Beziehen sich beide auf diese Zeile:
[signal, _tickerClose, _OP, hi ] = security(_ticker, timeframe.period, [f_strategy(), close, open, high])
Gesamtkontext:
//@version=4
study("Mutiple Alerts", overlay=true)
i_T1 = input('BTCUSD', type=input.symbol)
i_T2 = input('AMC', type=input.symbol)
i_T3 = input('AMD', type=input.symbol)
f_strategy() =>
smaFast = sma(close, 50)
smaSlow = sma(close, 200)
goLong = crossover(smaFast, smaSlow)
goShort = crossunder(smaFast, smaSlow)
// goLong := true
signal = goLong ? 1 : goShort ? -1 : 0
f_screener(ticker) =>
message = ''
[signal, _tickerClose, _OP, hi ] = security(_ticker, timeframe.period, [f_strategy(), close, open, high])
if signal == 1
message := "Buy " + _ticker + "@" + tostring(_tickerClose)
else if signal == -1
message := "Sell " + _ticker + "@" + tostring(_tickerClose)
if signal == 1 or signal == -1
alert(message, alert.freq_once_per_bar_close)
signal
t1_signal = f_screener(i_T1)
plot(t1_signal, title="T1 Signal")
t2_signal = f_screener(i_T2)
plot(t2_signal, title="T2 Signal")
t3_signal = f_screener(i_T3)
plot(t3_signal, title="T3 Signal")
plot(sma(close, 50), color=color.red)
plot(sma(close, 200), color=color.green)