Duplicate: Dealing With NaN and IFF translation

I am trying to convert a strategy that I have been using in Tradingview and I am having some issues with with finding a suitable conversion from PineScript for certain characters or functions such as;

A post was merged into an existing topic: Converting script and looking for suggestions....