简体   繁体   中英

Regarding Trading view In-built indicator Custom Screener

Recently I came across one beautiful trading view indicator that has made such a way that you can screen up to 100 scripts with own custom condition.

But there is one problem for me: I set my alert based on certain different pattern and made is as one pattern. Now I tried to put screenerFunc() as a pattern but it doesn't recognise and it's giving me the error

Cannot destructure expression of type 'series[bool]'. Tuple expected.

I tried to workaround but my almost all possibilities giving different error each time. Only I am looking for in label stock name that found that pattern so I don't need to check all chart for that same.

Indicator link is https://www.tradingview.com/script/hDKwJ8yo-CustomScreener/ .

This CustomScreener by TraderX_Unknown.

I know there may be a way I can screen my pattern in screenerfunction. If someone has an idea how to play with this code then please assist me to find out.

The screener function's output from the linked script contain 2 values and should be declared using the [] brackets. Both values cannot be assigned to a single variable, as per your error:

// Screener Function
screenerFunc() => 
    rsi  = rsi(close, rsi_length) // Value
    cond = rsi > rsi_overbought     // Condition
    [rsi, cond]

As can be seen in the original script, the screenerFunc is passed to the security() function as 2 variables have been assigned for each ticker: rsi value and a boolean condition:

[value1, name1]   = security(s_1, timeframe.period, screenerFunc())

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