Convert tradingview pine script to C# , including source code

Job ID: 39013988

Budget: €30 – €250 EUR

Hello everyone,


I need a tradingview pine script convert to C# code. My C# coding skills are OK, but I don't understand pine script. That's why I need help. I would like the source code though. The end result has to work. No missing functions. Here's the script :

//@version=5
indicator("Pi Cycle Top & Bottom Indicator [InvestorUnknown]", "Pi Cycle Top & Bottom Indicator", overlay=false)

// - - - - - INPUTS - - - - - //{
simple int short_len = input.int(111, "Short Length MA")
simple int long_len = input.int(350, "Long Length MA")

simple string ma_type = input.string("SMA", "Moving Average Type", options = ["SMA", "EMA"])
simple string mode = input.string("LOG(X)", "Oscillator Mode", options = ["RAW", "LOG(X)"])
//}

// - - - - - CALCULATIONS - - - - - //{
series float s_ma = switch ma_type
"SMA" => ta.sma(close, short_len)
"EMA" => ta.ema(close, short_len)

series float l_ma = switch ma_type
"SMA" => ta.sma(close, long_len)
"EMA" => ta.ema(close, long_len)

series float osc = switch mode
"RAW" => (s_ma / l_ma)
"LOG(X)" => math.log(s_ma / l_ma)

simple int base = mode == "RAW" ? 1 : 0
//}

// - - - - - Visualisation - - - - - //{
B = plot(base, "Base Line", color = color.new(color.gray, 80))
O = plot(osc, "Pi Cycle", linewidth = 3, color = color.orange)

color bcol =color.rgb(54, 208, 19)
color scol =color.rgb(227, 34, 34)

fill(O, B, osc > base ? osc : base, osc > base ? base : osc, osc > base ? scol : color.rgb(12,12,12,90), osc > base ? color.rgb(12,12,12,90) : bcol)
//}