Converting Pine script to Lua script Trading Indicator

Job ID: 37989635

Budget: $30 – $250 USD

I have a Pine Script trading indicator that I need to be converted to a Lua script for use in IQ Option. The job is essentially about adapting an existing script to a different language.

Key requirements:
- Convert an existing Pine Script trading indicator to Lua for use in IQ Option platform.
- No additional features or customizations needed.
- I prefer not to have comments explaining the code for future modifications.

Testing:
- The converted script should be tested for its accuracy in real-time on a demo account.

Ideal skills and experience:
- Proficiency in both Pine Script and Lua.
- Previous experience in adapting trading indicators across platforms.
- Experience in backtesting and real-time testing of trading scripts is a plus.

This is a relatively straightforward job and should not require more than basic script conversion skills.

Below is the script:

// © Infinity_Trading_
// Last Modified: 2/2/2022

//@version=5
indicator(title="Volume Pressure Bars", shorttitle="_Vol Bars", overlay=true, scale=scale.none, format=format.volume)


// Purpose: Transforms normal volume bars into buying and selling pressure bars. This allows user to easily see if there is more buying or selling on a given timeframe.
// Includes moving average line for the total volume of the bar. The moving average line can be adjusted by length and mathemtical function.

// Usage: This script allows the user to change the colors of the buy and sell pressure bars, toggle the moving average,
// and had built in scaling abilities to reduce the heigh of the volume bars when displayed on the same chart as price candles.


///////////////////////////////////////////////////////////////////////////////// INPUTS

var string GP1 = "Moving Average Line"
i_ma_line = input.bool(defval=true, title="Display Mov Avg Line", group=GP1)
i_length = input.int(defval=20, title="Length", minval=1, maxval=20, group=GP1)
i_ma_smoothing = input.string(defval="SMA", title="Smoothing", options=["RMA", "SMA", "EMA", "WMA"], group=GP1)

var string GPS = "Scaling"
i_scaling = input.bool(defval=false, title="Scale Bars", group=GPS)
i_scaling_factor = input.int(defval=10, title="Scaling Factor", step=1, group=GPS)

///////////////////////////////////////////////////////////////////////////////// HELPER FUNCTIONS

// Moving average helper function
ma_function(source, length) =>
switch i_ma_smoothing
"RMA" => ta.rma(source, length)
"SMA" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
=> ta.wma(source, length)


///////////////////////////////////////////////////////////////////////////////// VOLUME PRESSURE

buyingPressure = volume * (close - low) / (high - low)
sellingPressure = volume * (high - close) / (high - low)

percentSellingVol = math.round((sellingPressure / volume) * 100, 0)
percentBuyingVol = 100 - percentSellingVol


///////////////////////////////////////////////////////////////////////////////// HISTOGRAM


plot(volume, style=plot.style_columns, color=color.new(#10ac84, 0), title="Buy Vol Bar")
plot(sellingPressure, style=plot.style_columns, color=color.new(#b71540, 0), title="Sell Vol Bar & Label")
// Buying pressue is transparent to show buying volume in indicator label
plot(buyingPressure, style=plot.style_columns, color=color.new(#4caf50, 100), title="Buy Vol Label")


///////////////////////////////////////////////////////////////////////////////// LINES

mov_avg = ma_function(volume, i_length)
plot(i_ma_line ? mov_avg : na, style=plot.style_line, linewidth=2, color=color.new(#000000, 0), title="MA Line")


///////////////////////////////////////////////////////////////////////////////// SCALING

// Plot high line to scale down the columns
scaling_value = mov_avg * i_scaling_factor

plot(i_scaling ? scaling_value : na, title="limit", color=color.new(#00ffaa, 100))
Related categories: Lua Pine Script Trading