Undeclared identifier message sar/dmi strategy
Posted: Sat Dec 16, 2023 9:05 am
i'm building a strategy using the parabolic sar and DMI, Its my first time so im having a bit of trouble.
//@version=5
strategy(title="SAR ADX", initial_capital=150000, currency= currency.USD, default_qty_type= strategy.percent_of_equity)
// THE variables
sar = ta.sar(sar_acceleration, sar_acceleration, sar_maximum)
dmi = ta.dmi(di_Length, adx_Smoothing)
// Define inputs
sar_acceleration = input.float(0.02, title="SAR Acceleration")
sar_maximum = input.float(0.2, title="SAR Maximum")
len = input.int(17, minval=1, title="di Length")
lensig = input.int(14, title="adx Smoothing", minval=1, maxval=50)
[diplus, diminus, adx] = ta.dmi(len, lensig)
plot(adx, color=color.red, title="ADX")
plot(diplus, color=color.blue, title="+DI")
plot(diminus, color=color.orange, title="-DI")
i am kind of stuck in the begining, it tells me adx smoothing is an undeclared identifier, i tried all sorts of combinations getting the names exactly the same between the variables and the inputs, but it still gives the same message, can someone tell me what im doing wrong?
//@version=5
strategy(title="SAR ADX", initial_capital=150000, currency= currency.USD, default_qty_type= strategy.percent_of_equity)
// THE variables
sar = ta.sar(sar_acceleration, sar_acceleration, sar_maximum)
dmi = ta.dmi(di_Length, adx_Smoothing)
// Define inputs
sar_acceleration = input.float(0.02, title="SAR Acceleration")
sar_maximum = input.float(0.2, title="SAR Maximum")
len = input.int(17, minval=1, title="di Length")
lensig = input.int(14, title="adx Smoothing", minval=1, maxval=50)
[diplus, diminus, adx] = ta.dmi(len, lensig)
plot(adx, color=color.red, title="ADX")
plot(diplus, color=color.blue, title="+DI")
plot(diminus, color=color.orange, title="-DI")
i am kind of stuck in the begining, it tells me adx smoothing is an undeclared identifier, i tried all sorts of combinations getting the names exactly the same between the variables and the inputs, but it still gives the same message, can someone tell me what im doing wrong?