简体   繁体   中英

The function call parameters do not match the function signature

Issue: I got below errors says need to declare variable for some-reason it is not recognizing my variables

platform: webull

在此处输入图像描述

Erros: line 11: Before they are used, all variables have to be declared. line 11: This variable is not callable. line 12: The function call parameters do not match the function signature.

My Code:

// Define the number of bars to calculate volume increase/decrease
numOfBars = input(14, "Number of bars", minval=1)
// Calculate the volume increase/decrease
volIncrease = volume - nz(volume[numOfBars])
// Define the threshold for a volume increase to trigger a buy signal
buyThreshold = input(200, "Buy threshold", minval=1)
// Define the threshold for a volume decrease to trigger a sell signal
sellThreshold = input(-200, "Sell threshold", minval=-1)

// Plot the buy
signalbuySignal = cross(volIncrease, buyThreshold)
plot(buySignal, style=plot.style_cross, color=color.green, title="Buy")

sellSignal = crossunder(volIncrease, sellThreshold)
plot(sellSignal, style=plot.style_cross, color=color.red, title="Sell")

// EMA Calculations
EMA8 = ema(close, 9)
EMA21 = ema(close, 20)
EMA34 = ema (close, 34)
EMA50 = ema(close, 50)

// Top Charts
topcloud1 = plot(series = EMA8, title = "EMA8", color = color.yellow)
topcloud2 = plot(series = EMA21, title = "EMA21", color = color.yellow)
fill(topcloud1, topcloud2, color=iff(EMA8>EMA21, color.green, color.red), opacity = 40)

// Bottom Charts
bottomcloud1 = plot(series = EMA34, title = "EMA34", color = color.blue)
bottomcloud2 = plot(series = EMA50, title = "EMA50", color = color.blue)
fill(bottomcloud1, bottomcloud2, color =iff(EMA34>EMA50, color.green, color.red), opacity = 40)

Expected result: This indicator should help me to add buy sell signal based on volume increase or decrease

I tried to use cross, crossover, crossunder everything has same problem.

can someone help me on this?

Your script is missing the version declaration and a study or indicator call.

Additionally, you are passing a bool to plot() below as its series argument which will not work and give you a compile error.

// Plot the buy signal
buySignal = cross(volIncrease, buyThreshold)
plot(buySignal, style=plot.style_cross, color=color.green, title="Buy")

sellSignal = crossunder(volIncrease, sellThreshold)
plot(sellSignal, style=plot.style_cross, color=color.red, title="Sell")

Lastly, fill() has no argument called opacity .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM