Pinescript to lua Conversion

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Pinescript to lua Conversion

Postby jamrocktrader » Thu Mar 24, 2016 4:01 am

Hi Apprentice,

Can you convert the following pinescript to a lua indicator and add an alert for color change.
-------------------------------------------------------------------------------------------------------------------

//CM_Modified_Heikin-Ashi_TrendBars by ChrisMoody
//Modified Heikinashi with EMA Filter...
//Choice To Plot EMA Trend Is Based Off Of
study(title = "CM_Modified_Heik_Trend_Bars", shorttitle="CM_TrendBars",overlay=true)
note = input(false, title="Lower Numbers = More Sensitive to Price Change...Higher Numbers = Less Sensitive")
uema = input(34, minval=1, maxval=50, title="EMA UpTrend")
dema = input(34, minval=1, maxval=50, title="EMA DownTrend")
shema = input(false, title="Show EMA Trend is Based On?")

haclose = (open + high + low + close)/4
haopen = na(haopen[1]) ? (open + close)/2 : (haopen[1] + haclose[1]) / 2

upEma = ema(haclose, uema)
downEma = ema(haopen, dema)

emaAvg = (upEma + downEma)/2

heikUpColor() => hlc3 >= emaAvg
heikDownColor() => hlc3 < emaAvg

col = hlc3 >= emaAvg[1] ? lime : hlc3 < emaAvg[1] ? red : white

barcolor(heikUpColor() ? lime: heikDownColor() ? red : na)
plot(shema and emaAvg ? emaAvg : na, title="EMA UpTrend", style=line, linewidth=3, color=col)
---------------------------------------------------------------------------------------------------------------------

You can view the indicator and source code at the following link https://www.tradingview.com/chart/?symbol=GBPUSD

- To insert indicator
Right click on the chart
Click insert indicator
Enter ‘CM_Modified_Heikin-Ashi_TrendBars’ in the search bar


Thank You
jamrocktrader
 
Posts: 19
Joined: Mon Jul 06, 2015 10:05 pm

Re: Pinescript to lua Conversion

Postby Jennieh814 » Fri Apr 26, 2019 8:59 am

Hi apprentice

Thanks but it's a slightly different indicator. Please see attached
Attachments
Screenshot_20190426-130304.png
Jennieh814
 
Posts: 16
Joined: Thu Apr 25, 2019 3:36 pm

Re: Pinescript to lua Conversion

Postby Jennieh814 » Fri Apr 26, 2019 9:00 am

Hi apprentice

Thanks but it's a slightly different indicator. Please see attached
Jennieh814
 
Posts: 16
Joined: Thu Apr 25, 2019 3:36 pm

Re: Pinescript to lua Conversion

Postby Apprentice » Sat Apr 27, 2019 4:31 am

Your request is added to the development list under Id Number 4627
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36428
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia



Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 9 guests