Pinescript syntax to pseudocode

Viewed 28

So I'm trying to understand thos lines and coming from C# and Python I'm having a hard time to understand this syntax :

rv = b < c*a

sl = rv == 1 and high > y and close < y and open < y

ss = rv == 1 and low < x and close > x and open > x 

li = sl ? y : ss ? x : (x+y)/2
1 Answers
  1. rv = b < c*a - result is a bool variable rv which value (true or false) depends of the expression b < c*a.

  2. sl = rv == 1 and high > y and close < y and open < y result is a bool variable, expression can be simplified as

    sl = b1 and b2 and b3 and b4 where:

    b1 = rv == 1 (true or false)

    b2 = high > y (true or false)

    b3 = close < y (true or false)

    b4 = open < y (true or false)

  3. same

  4. is a ternary operator https://www.tradingview.com/pine-script-docs/en/v5/language/Operators.html#ternary-operator

Related