Conversion de l’indicateur The Echo Forecast par AlgoLux de tradingview
Forums › ProRealTime forum Français › Support ProBuilder › Conversion de l’indicateur The Echo Forecast par AlgoLux de tradingview
- This topic has 6 replies, 2 voices, and was last updated 1 year ago by majide.
-
-
04/01/2023 at 6:43 PM #212644
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo//@version=4
study(“The Echo Forecast [LUX]”,”ECHO [LuxAlgo]”,overlay=true,max_bars_back=1000,max_lines_count=200)
length = input(50,’Evaluation Window’,minval=0,maxval=200)
fcast = input(50,’Forecast Window’,minval=1,maxval=200)fmode = input(‘Similarity’,’Forecast Mode’,options=[‘Similarity’,’Dissimilarity’])
cmode = input(‘Cumulative’,’Forecast Construction’,options=[‘Cumulative’,’Mean’,’Linreg’])
src = input(close)fcast_col = input(#2157f3,’Forecast Style’,inline=’fcast_style’,group=’Style’)
fcast_style = input(‘· · ·’,”,options=[‘──’,’- – -‘,’· · ·’],inline=’fcast_style’,group=’Style’)show_area = input(true,’Show Area’,inline=’areas’,group=’Style’)
fcast_area = input(color.new(#ff5d00,50),”,inline=’areas’,group=’Style’)
corr_area = input(color.new(#0cb51a,50),”,inline=’areas’,group=’Style’)
eval_area = input(color.new(color.gray,50),”,inline=’areas’,group=’Style’)
//—-
var lines = array.new_line(0)
if barstate.isfirst
for i = 0 to fcast-1
array.push(lines,line.new(na,na,na,na))
//—-
n = bar_index
d = change(src)top = highest(src,length+fcast*2)
btm = lowest(src,length+fcast*2)if barstate.islast
float val = na
k = 0
A = array.new_float(0)
X = array.new_int(0)
for i = 0 to fcast*2+length
array.push(A,src[i])
if cmode == ‘Linreg’
array.push(X,n[i])a = array.slice(A,0,fcast-1)
for i = 0 to length-1
b = array.slice(A,fcast+i,fcast*2+i-1)
r = array.covariance(a,b)/(array.stdev(a)*array.stdev(b))
if fmode == ‘Similarity’
val := r >= nz(val,r) ? r : val
else
val := r <= nz(val,r) ? r : val
k := val == r ? i : kprev = src
current = srcfor i = 0 to fcast-1
e = d[fcast+k+(fcast-i-1)]
if cmode == ‘Mean’
current := array.avg(a) + e
else if cmode == ‘Linreg’
a = array.slice(A,0,fcast)
x = array.slice(X,0,fcast)
alpha = array.covariance(a,x)/array.variance(x)
beta = array.avg(a) – alpha*array.avg(x)
current := alpha*(n+i+1) + beta + e
else
current += el = array.get(lines,i)
line.set_xy1(l,n+i,prev)
line.set_xy2(l,n+i+1,current)
line.set_color(l,fcast_col)if fcast_style == ‘- – -‘
line.set_style(l,line.style_dashed)
else if fcast_style == ‘· · ·’
line.set_style(l,line.style_dotted)prev := current
if show_area
box.delete(box.new(n-length-fcast*2+1,top,n-fcast+1,btm,
border_color=na,
bgcolor=eval_area)[1])
box.delete(box.new(n-fcast+1,top,n,btm,
border_color=na,
bgcolor=fcast_area)[1])
box.delete(box.new(n-k-fcast*2+1,btm,n-k-fcast,top,
border_color=na,
bgcolor=corr_area)[1])04/01/2023 at 6:45 PM #212645// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo//@version=4
study(“The Echo Forecast [LUX]”,”ECHO [LuxAlgo]”,overlay=true,max_bars_back=1000,max_lines_count=200)
length = input(50,’Evaluation Window’,minval=0,maxval=200)
fcast = input(50,’Forecast Window’,minval=1,maxval=200)fmode = input(‘Similarity’,’Forecast Mode’,options=[‘Similarity’,’Dissimilarity’])
cmode = input(‘Cumulative’,’Forecast Construction’,options=[‘Cumulative’,’Mean’,’Linreg’])
src = input(close)fcast_col = input(#2157f3,’Forecast Style’,inline=’fcast_style’,group=’Style’)
fcast_style = input(‘· · ·’,”,options=[‘──’,’- – -‘,’· · ·’],inline=’fcast_style’,group=’Style’)show_area = input(true,’Show Area’,inline=’areas’,group=’Style’)
fcast_area = input(color.new(#ff5d00,50),”,inline=’areas’,group=’Style’)
corr_area = input(color.new(#0cb51a,50),”,inline=’areas’,group=’Style’)
eval_area = input(color.new(color.gray,50),”,inline=’areas’,group=’Style’)
//—-
var lines = array.new_line(0)
if barstate.isfirst
for i = 0 to fcast-1
array.push(lines,line.new(na,na,na,na))
//—-
n = bar_index
d = change(src)top = highest(src,length+fcast*2)
btm = lowest(src,length+fcast*2)if barstate.islast
float val = na
k = 0
A = array.new_float(0)
X = array.new_int(0)
for i = 0 to fcast*2+length
array.push(A,src[i])
if cmode == ‘Linreg’
array.push(X,n[i])a = array.slice(A,0,fcast-1)
for i = 0 to length-1
b = array.slice(A,fcast+i,fcast*2+i-1)
r = array.covariance(a,b)/(array.stdev(a)*array.stdev(b))
if fmode == ‘Similarity’
val := r >= nz(val,r) ? r : val
else
val := r <= nz(val,r) ? r : val
k := val == r ? i : kprev = src
current = srcfor i = 0 to fcast-1
e = d[fcast+k+(fcast-i-1)]
if cmode == ‘Mean’
current := array.avg(a) + e
else if cmode == ‘Linreg’
a = array.slice(A,0,fcast)
x = array.slice(X,0,fcast)
alpha = array.covariance(a,x)/array.variance(x)
beta = array.avg(a) – alpha*array.avg(x)
current := alpha*(n+i+1) + beta + e
else
current += el = array.get(lines,i)
line.set_xy1(l,n+i,prev)
line.set_xy2(l,n+i+1,current)
line.set_color(l,fcast_col)if fcast_style == ‘- – -‘
line.set_style(l,line.style_dashed)
else if fcast_style == ‘· · ·’
line.set_style(l,line.style_dotted)prev := current
if show_area
box.delete(box.new(n-length-fcast*2+1,top,n-fcast+1,btm,
border_color=na,
bgcolor=eval_area)[1])
box.delete(box.new(n-fcast+1,top,n,btm,
border_color=na,
bgcolor=fcast_area)[1])
box.delete(box.new(n-k-fcast*2+1,btm,n-k-fcast,top,
border_color=na,
bgcolor=corr_area)[1])04/03/2023 at 7:58 AM #21270404/03/2023 at 5:24 PM #212743Bonjour,
Désolé pour le post en double (faute de frappe).
L’indicateur The-Echo-Forecast-LUxAlgo extrapole l’évolution des cours des dernières séances pour calculer l’évolution prochaine des cours. C’est un indicateur TradingView gratuit dont le code entier est contenu dans le document pdf ci-joint.
Je souhaiterai pouvoir l’utiliser dans ProRealTime mais les traductions que j’ai faites du langage Pine en langage Probuilder ne fonctionnent pas.
Merci pour votre réponse et pour votre aide,
Cordialement,
Majide
04/03/2023 at 5:31 PM #21274604/06/2023 at 7:46 AM #212914Je vois, je pense que cela a déjà été demandé. Malheuresement sans le support des fonctions en ProBuilder, il sera très difficile de le reproduire. L’ajout des fonctions est à l’étude, il faudra encore plusieurs mois je pense avant que cela arrive.
04/06/2023 at 1:42 PM #212941 -
AuthorPosts
Find exclusive trading pro-tools on