- 29 May 2019
- 5
- 0
Selamlar herkese, konuyu umarım doğru yere açmışımdır.
Hatalıysa kusuruma bakılmasın lütfen.
Elimde bir kodlama var ama sanırım bir program için yazılmış 10 satırlık birşey.
Ben bu kodu Web sitesinde pine editor kısmında eklmeye çalıştığımda hata alıyorum, sanırım web'e uygun şekilde kodlu değil.
Bana bu kodu gereken siteye göre düzeltebilecek bir yardım sever yazılım, kodlama bilen birisi yardımcı olabilir mi acaba ?
Uygulanması gereken ana fikir : My setup for day trading the 5 min Emini has 20 bar exponential moving average (EMA). In addition to the 5 minute 20 bar EMA, I also have the 60 minute 20 bar EMA written in a way that allows me to plot it on the 5 minute chart
2 farklı extension moving average : birisi 5 dakikalık ,20 barlık ( mum ) ema - - - diğeri ise 60 dakikalık 20 barlık ( mum ) ema - - - tek kodlamada 2 farklı indikatörü birleştirmek olay ama espirisi 5 dakikalık 20 bar Ema ve 60 dakikalık 20 bar Ema
Uygulandığında ortaya çıkacak görsel :
Uygulanmak istenen site : tradingview.com
Alt ta pine editörde deneyebilirsiniz
Buda program için hazırlanmış görseli
Pine Editör içinde şöye bir açıklama buldum yardımcı olması açısından EMA kodlaması için bilgi vermiş
[/B]
Hatalıysa kusuruma bakılmasın lütfen.
Elimde bir kodlama var ama sanırım bir program için yazılmış 10 satırlık birşey.
Ben bu kodu Web sitesinde pine editor kısmında eklmeye çalıştığımda hata alıyorum, sanırım web'e uygun şekilde kodlu değil.
Bana bu kodu gereken siteye göre düzeltebilecek bir yardım sever yazılım, kodlama bilen birisi yardımcı olabilir mi acaba ?
Uygulanması gereken ana fikir : My setup for day trading the 5 min Emini has 20 bar exponential moving average (EMA). In addition to the 5 minute 20 bar EMA, I also have the 60 minute 20 bar EMA written in a way that allows me to plot it on the 5 minute chart
2 farklı extension moving average : birisi 5 dakikalık ,20 barlık ( mum ) ema - - - diğeri ise 60 dakikalık 20 barlık ( mum ) ema - - - tek kodlamada 2 farklı indikatörü birleştirmek olay ama espirisi 5 dakikalık 20 bar Ema ve 60 dakikalık 20 bar Ema
Uygulandığında ortaya çıkacak görsel :
Uygulanmak istenen site : tradingview.com
Alt ta pine editörde deneyebilirsiniz
Buda program için hazırlanmış görseli
Pine Editör içinde şöye bir açıklama buldum yardımcı olması açısından EMA kodlaması için bilgi vermiş
Kod:
/ [USER=423072]version[/USER]=3
// At the very start of the pine script we always declare the version we are going to use,
// You can see, above we are using the version 3 of the pine script
// The [USER=423072]version[/USER] word in pine script must be commented at the begning of the script
study("Coding ema in pinescript", overlay=true)
// This is where we are defining the study,
// A study function in the pinescipt is used to tell the pine script that we will be building an indicator
// the use of " overlay=true ", lets the pine script know that you want to overlay the plot in the charts on to the
// candlestick chart.
// now we define an EMA function, named pine_ema with 2 arguments x and y
// the sole aim of this pine_ema function is to return the curent ema of the current candle closing price
pine_ema(src, time_period) =>
alpha = 2 / (time_period + 1)
// we have defined the alpha function above
ema = 0.0
// this is the initial declaration of ema, since we dont know the first ema we will declare it to 0.0 [as a decimal]
ema := alpha * src + (1 - alpha) * nz(ema[1])
// this returns the computed ema at the current time
// notice the use of : (colon) symbol before =, it symbolises, that we are changing the value of ema,
// since the ema was previously declared to 0
// this is called mutable variale declaration in pine script
ema
// return ema from the function
_10_period_ema = pine_ema(close, 10)
// here we just called our function with a src of close and time_period of value 10
plot(_10_period_ema, color=red, transp=30, linewidth=2)
// now we plot the _10_period_ema
Son düzenleme: