如何向 request.security() 添加布尔值?

How to add a bool to request.security()?

如何向 request.security 添加布尔值? 所以我可以尝试在 a 和 b 之间进行选择 示例:

a = request.security(symbol, timeframe, expression, gaps, lookahead, ignore_invalid_symbol)    
b = request.security(symbol, timeframe, expression, gaps, lookahead, ignore_invalid_symbol)    
c = a or/ and b

plot(c)

您可以使用 ternary operator

bool choose_a = true

a = request.security(symbol, timeframe, expression, gaps, lookahead, ignore_invalid_symbol)    
b = request.security(symbol, timeframe, expression, gaps, lookahead, ignore_invalid_symbol)    
c = choose_a ? a : b  // if choose_a is true, use a. Else, use b

plot(c)