Modified 'Three Libe Break' Request

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

Modified 'Three Libe Break' Request

Postby TLBshifted » Wed Apr 14, 2021 9:01 am

Is it possible to translate the following into lua? This code cones from tradingview website. Thanks

//@version=3
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 30/05/2019
// This is a modified version of the three line break price representation.
// It is composed with 2 lines made of Close price values forming a “cloud”.
// If the trend is bullish and the price breach the lower level of the green
// cloud, a new bearish trend is taking place.
// If the current trend is bearish and the price breakout the upper band of
// the cloud, a new bullish trend is forming.
// This is a “price action” indicator, signals may be filtered by long term trend
// analysis with other indicators such as Supertrend for instance.
////////////////////////////////////////////////////////////
study(title="Three Line Break", overlay = true)
xtrend = 1
xu = close
xu1 = close
xu2 = close
xu3 = close
if xtrend[1] == 1
if close > xu[1]
xu3 := xu2[1]
xu2 := xu1[1]
xu1 := xu[1]
xu := close
xtrend := 1
else
if close < xu3[1]
xu3 := xu1[1]
xu2 := xu1[1]
xu1 := xu1[1]
xu := close
xtrend := -1
else
xtrend := 1
else
if close > xu3[1]
xu3 := xu1[1]
xu2 := xu1[1]
xu1 := xu1[1]
xu := close
xtrend := 1
else
if close < xu[1]
xu3 := xu2[1]
xu2 := xu1[1]
xu1 := xu[1]
xu := close
xtrend := -1
else
xtrend := -1
colorm = xtrend == -1 ? red: xtrend == 1 ? green : blue
p1 = plot(xu, color=colorm)
p2 = plot(xu3, color=colorm)
fill(p1, p2, color=colorm)
TLBshifted
 
Posts: 6
Joined: Wed Apr 14, 2021 8:55 am

Re: Modified 'Three Libe Break' Request

Postby Apprentice » Thu Apr 15, 2021 5:02 am

Your request is added to the development list.
Development reference 357.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 29698
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 7 guests