CCI al-sat indikatörüMerhabalar cci indikatörü üzerine 4 durum için aşağıda verdiğim pine script kodu ile yazmış olduğum üzere alarm koyabilirsiniz. 4 saatlik grafikte daha iyi çalışır.
Not : hata verirse burada kodları kopyala yapıştır yaparken hata oluyor
iff(xSMA > xFMA, -1, nz(pos , 0)))
kodunu 2 tab ileri alınız
a) -100 aşırı alım bilgesi
b) 100 aşırı satım
c) yukarı kesişim
d) aşağı kesişim
study(title="CCI AŞIRI ALIM VE SATIM", shorttitle="CCI strategy")
asiriAlimSeviyesi=input(-100, title="Aşırı Alım Seviyesi")
asiriSatimSeviyesi=input(100, title="Aşırı Alım Seviyesi")
FastMA = input(10, minval=1)
SlowMA = input(20, minval=1)
hline(0, color=purple, linestyle=dashed)
hline(100, color=black, linestyle=dashed)
hline(-100, color=black, linestyle=dashed)
xCCI = cci(close, 10)
xSMA = sma(xCCI,SlowMA)
xFMA = sma(xCCI,FastMA)
pos = iff(xSMA < xFMA , 1,
iff(xSMA > xFMA, -1, nz(pos , 0)))
barcolor(pos == -1 ? red: pos == 1 ? green : blue)
plot(xSMA, color=red, title="CCI MA Slow")
plot(xFMA, color=blue, title="CCI MA FAST")
yukariKeser=crossover(xFMA, xSMA)
asagiKeser=crossunder(xFMA, xSMA)
alertcondition(yukariKeser, title="Yukarı keser", message="Yukari keser")
alertcondition(asagiKeser, title="Aşağı Keser ", message="Aşağı Keser keser")
alimsarti=crossunder(xFMA, asiriAlimSeviyesi)
alertcondition(alimsarti, title="Al", message="Al")
plotshape(alimsarti,size=size.small,style=shape.labelup,location=location.bottom,text="AL")
satimsarti=crossover(xFMA, asiriSatimSeviyesi)
alertcondition(satimsarti, title="SAT", message="SAT")
plotshape(satimsarti,size=size.small,style=shape.labelup,location=location.top,text="SAT")
Fikirleri "Pine Script" için ara
btcusdIchimoku bulutu ve hareketli ortalamaya göre çalışan pine script kodu aşağıdadır.
//@version=2
//strategy('Complete Ichimoku Trader *modified* - original by @kingthies / mod by @cryptomrdavis', shorttitle='Complete Ichimoku Trader *modified* - original by @kingthies / mod by @cryptomrdavis', overlay=true)
study('Complete Ichimoku Trader *modified* - by @cryptomrdavis -', shorttitle='Complete Ichimoku Trader *modified* - @cryptomrdavis -', overlay=true)
sp = input(true, title="Welcome to the modified Version of the Complete Ichimoku Trader - original by @ethies. This version has some extra lines of code and gives you less signals as the original one.")
haopen = open
hahigh = high
halow = low
haclose = close
heikUpColor() => haclose > haopen
heikDownColor() => haclose <= haopen
o = haopen
c = haclose
src = haclose
price = haclose
rsilength = input(13, title="RSI")
VolSMA = input(20, title="Volume")
uptrendlength = input(2, title="Uptrend Length")
downtrendlength = input(2, title="Downtrend Length")
ShowCloud = input(false, title="Show Ichimoku Cloud?")
ShowIchiLines = input(false, title="Show Ichimoku Lines?")
v1 = volume
v2 = sma(volume,VolSMA)
//RSI//
up1 = rma(max(change(src), 0), 9)
down1 = rma(-min(change(src), 0), 9)
rsi = down1 == 0 ? 100 : up1 == 0 ? 0 : 100 - (100 / (1 + up1 / down1))
K = sma(stoch(c, hahigh, halow, 14), 3)
D = sma(K, 3)
myrsi = rsi(c,rsilength)
//KDJ//
ilong = 9
isig = 3
bcwsma(s,l,m) =>
_s = s
_l = l
_m = m
_bcwsma = (_m*_s+(_l-_m)*nz(_bcwsma ))/_l
_bcwsma
h = highest(hahigh, ilong)
l = lowest(halow,ilong)
RSV = 100*((c-l)/(h-l))
pK = bcwsma(RSV, isig, 1)
pD = bcwsma(pK, isig, 1)
pJ = 3 * pK-2 * pD
KD = avg(pK,pD)
//EMAs//
EMA5 = ema(price,5)
EMA7 = ema(price,7)
EMA10 = ema(price,10)
EMA14= ema(price,14)
VOLEMA = avg(volume,20)
/// --- TREND --- ///
avghigh = sma(h, uptrendlength)
avglow = sma(l, downtrendlength)
uptrend = h > avghigh
downtrend = l < avglow
//ICHIMOKU BUY & SELL//
conversionPeriods = 9
basePeriods = 26
laggingSpan2Periods = 52
displacement = 26
donchian(len) => avg(lowest(len), highest(len))
resolve(src, default) =>
if na(src)
default
else
src
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = offset(avg(conversionLine, baseLine), displacement)
leadLine2 = offset(donchian(laggingSpan2Periods), displacement)
tk_cross_bull = crossover(conversionLine, baseLine)
tk_cross_bear = crossunder(conversionLine, baseLine)
cross_y = (conversionLine * (baseLine - baseLine ) - baseLine * (conversionLine - conversionLine )) / ((baseLine - baseLine ) - (conversionLine - conversionLine ))
tk_cross_below_kumo = cross_y <= leadLine2 and cross_y <= leadLine1 and cross_y <= leadLine2 and cross_y <= leadLine1
tk_cross_above_kumo = cross_y >= leadLine2 and cross_y >= leadLine1 and cross_y >= leadLine2 and cross_y >= leadLine1
tk_cross_inside_kumo = (not tk_cross_below_kumo) and (not tk_cross_above_kumo)
pk_cross_bull = crossover(haclose, baseLine)
pk_cross_bear = crossunder(haclose, baseLine)
cross_pk_y = (haclose * (baseLine - baseLine ) - baseLine * (haclose - haclose )) / ((baseLine - baseLine ) - (haclose - haclose ))
pk_cross_below_kumo = cross_pk_y <= leadLine2 and cross_pk_y <= leadLine1 and cross_pk_y <= leadLine2 and cross_pk_y <= leadLine1
pk_cross_above_kumo = cross_pk_y >= leadLine2 and cross_pk_y >= leadLine1 and cross_pk_y >= leadLine2 and cross_pk_y >= leadLine1
pk_cross_inside_kumo = (not pk_cross_below_kumo) and (not pk_cross_above_kumo)
kumo_bull = (crossover(haclose, leadLine1) and leadLine1 > leadLine2) or (crossover(haclose, leadLine2) and leadLine2 > leadLine1)
kumo_bear = (crossunder(haclose, leadLine2) and leadLine1 > leadLine2) or (crossunder(haclose, leadLine1) and leadLine2 > leadLine1)
price_below_kumo = (haclose < leadLine2 and haclose < leadLine1)
price_above_kumo = (haclose > leadLine2 and haclose > leadLine1)
price_inside_kumo = (not price_below_kumo) and (not price_above_kumo)
no_dp_leadLine1 = avg(conversionLine, baseLine)
no_dp_leadLine2 = donchian(laggingSpan2Periods)
lead_line_cross_bull = crossover(no_dp_leadLine1, no_dp_leadLine2)
lead_line_cross_bear = crossunder(no_dp_leadLine1, no_dp_leadLine2)
price_below_kumo := (haclose < no_dp_leadLine2 and haclose < no_dp_leadLine1)
price_above_kumo := (haclose > no_dp_leadLine2 and haclose > no_dp_leadLine1)
price_inside_kumo := (not price_below_kumo) and (not price_above_kumo)
past_price = offset(haclose, displacement)
lag_line_bull_cross = haclose > haclose
lag_line_bear_cross = haclose < haclose
past_price_below_kumo = (past_price < leadLine2 and past_price < leadLine1)
past_price_above_kumo = (past_price > leadLine2 and past_price > leadLine1)
past_price_inside_kumo = (leadLine2 < past_price and past_price < leadLine1) and (leadLine1 < past_price and past_price < leadLine2)
//BUY & SELL
buycond = (tk_cross_below_kumo or tk_cross_inside_kumo or tk_cross_above_kumo) and rising(pJ ,1) and heikUpColor() and uptrend and v1 >= v2 and rising(myrsi,1) or
(pk_cross_below_kumo or pk_cross_inside_kumo or pk_cross_above_kumo) and rising(pJ ,1) and heikUpColor() and uptrend and v1 >= v2 and rising(myrsi,1) or
(past_price_below_kumo or past_price_above_kumo or past_price_inside_kumo) and rising(pJ ,1) and heikUpColor() and uptrend and v1 >= v2 and rising(myrsi,1)
sellcond = (tk_cross_below_kumo or tk_cross_inside_kumo or tk_cross_above_kumo) and falling(pJ ,1) and heikDownColor()and falling(myrsi,1) and downtrend or
(pk_cross_below_kumo or pk_cross_inside_kumo or pk_cross_above_kumo) and falling(pJ ,1) and heikDownColor() and falling(myrsi,1) and downtrend or
(past_price_below_kumo or past_price_above_kumo or past_price_inside_kumo) and falling(pJ ,1) and heikDownColor() and falling(myrsi,1) and downtrend
signalfilter = 0
signalfilter := sellcond ? 1 : buycond ? 2 : nz(signalfilter )
filvar = signalfilter == 1 ? 1:0
buySignal = (signalfilter != signalfilter and filvar == 0)
sellSignal = (signalfilter != signalfilter and filvar == 1)
//PLOT
plotshape(buySignal, color=green, text= "AL", location= location.belowbar,style= shape.labelup, textcolor=white, size = size.tiny, title="Buy Alert",editable=false, transp=30)
plotshape(sellSignal, color=red, text= "SAT", location= location.abovebar,style= shape.labeldown, textcolor=white, size = size.tiny, title="Sell Alert", editable=false, transp=30)
SenkouA = donchian(laggingSpan2Periods)
SenkouB = (conversionLine + baseLine ) / 2
plot(ShowIchiLines and conversionLine ? conversionLine : na, color=red, title="Tenkan")
plot(ShowIchiLines and baseLine ? baseLine : na, color=blue, title="Kijun")
plot(ShowIchiLines and price ? price : na, color= teal , title="Chikou", offset = -displacement)
A = plot(ShowCloud and SenkouA ? SenkouA : na, color=purple, title="SenkouA")
B = plot(ShowCloud and SenkouB ? SenkouB : na, color=green, title="SenkouB")
fill(A, B, color=green)
//Alert Conditions
alertcondition(buySignal, title='AL', message='AL')
alertcondition(sellSignal, title='SAT', message='SAT')
btc'nın aşırı alış ve satışı4 saatlik grafikte aşağıda verdiğim btc'nin rsi değeri değeri 20-80 değerlerine göre aşırı alış ve satış pine script kodlarını verdim ve alarmda ekeldim.
siz isterseniz rsi 30-70'e göre de ayarlayabilirsiniz.
Muhtemelen rsi 80 aşırı alış değerinden sonra btc fiyatı düşecektir.
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © ozgurhan
//@version=4
study(title="rsi asiri alis ve satis", shorttitle="rsi asiri alis ve satis", overlay=true)
// inputlar
rsiLength = input(14, title="RSI Length:", type=input.integer, minval=1)
rsi_asiri_alis = input(80, title="RSI Aşırı alış:", type=input.integer, minval=1)
rsi_asiri_satis = input(20, title="RSI Aşırı satış:", type=input.integer, minval=1)
drawOnRT = input(title="Draw On Candles Yet To Close:", type=input.bool, defval=true)
// aşırı alış ve satış değerleri
rsi = rsi(close, rsiLength)
rsi_alis = rsi >= rsi_asiri_alis
rsi_satis = rsi <= rsi_asiri_satis
// Plotlar ve alarmlar
plotshape(rsi_satis and (barstate.ishistory or drawOnRT), title= "Aşırı satış", location=location.belowbar, color=color.green, transp=0, style=shape.triangleup, text="BUY")
plotshape(rsi_alis and (barstate.ishistory or drawOnRT), title= "Aşırı alış", color=color.red, transp=0, style=shape.triangledown, text="SELL")
alertcondition(rsi_alis or rsi_satis, title="RSI+ Alert!", message="RSI Alert for ")
Hull Moving Average v1I am publishing the Hull Moving Average v1 pine script code. I hope that will be useful.
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © ozgurhan
//@version=4
study(title="Hull Moving Average v1", shorttitle="HMA v1", resolution="", overlay=true)
length = input(55, minval=1)
src = input(close, title="Source")
hullma = wma(2*wma(src, length/2)-wma(src, length), floor(sqrt(length)))
var linecolor = color.white
if hullma > hullma and close > hullma
linecolor := color.green
else if (hullma > hullma and close < hullma) or (hullma < hullma and close > hullma)
linecolor := color.orange
else
linecolor := color.red
plot(hullma, color=linecolor, linewidth=2, transp=40)
plot(hullma, color=linecolor, linewidth=10, transp=0)
green=(hullma > hullma and close > hullma)
orange=(hullma > hullma and close < hullma) or (hullma < hullma and close > hullma)
b1=barssince(green)
s1=barssince(orange)
plotshape(green and b1 >s1 , size=size.small, style=shape.labelup, location=location.belowbar, color=color.green, text="BUY", textcolor=color.black)
plotshape(orange and s1 >b1 , size=size.small, style=shape.labeldown, location=location.abovebar, color=color.red, text="SELL", textcolor=color.black)
alertcondition(green and b1 >s1 , title="BUY", message="BUY")
alertcondition(orange and s1 >b1 , title="SELL", message="SELL")
RSI aşırı alış ve aşıri satış indikatörüFiyatların çok indiği veya yükseldiği zamanlara rsi indikatörü aşırı alış ve satış indikatörü çok işe yarar.
Şu an fiyatlar aşırı iniş yaptığı için Al sinyali işinizi görebilir.
Pine script kodları aşağıdadır.
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © ozgurhan
//@version=4
study("RSI asiri alim ve satım", overlay=true)
rsi_asiri_satim=input(30, title="rsi aşırı satım")
rsi_asiri_alim=input(70, title="rsi aşırı alım")
rsi_degeri=rsi(close,14)
alimKosulu=crossover(rsi_degeri,rsi_asiri_satim)
satimKosulu=crossunder(rsi_degeri, rsi_asiri_alim)
b1=barssince(alimKosulu)
s1=barssince(satimKosulu)
plotshape(alimKosulu and b1 >s1 , size=size.small, style=shape.labelup, location=location.belowbar, color=color.green, text="AL", textcolor=color.black)
plotshape(satimKosulu and s1 >b1 , size=size.small, style=shape.labeldown, location=location.abovebar, color=color.red, text="SAT", textcolor=color.black)
alertcondition(alimKosulu and b1 >s1 , title="aşırı alım", message="aşırı alım")
alertcondition(satimKosulu and s1 >b1 , title="satim kosulu", message="aşırı satım")
ifstoch ve macd indikatörlerinin birleşimiMerhabalar aşağıdaki pine script kodnda ifstoch ve macd indikatörlerini birleştirerek aşırı alım ve satım noktalarında macd indikatörünün aşağı ve yukarı kesimlerinide katarak al ve sat kodu oluşturdum.
Al ve sat üzerine alarm kurabilirsiniz.
if stoch yukarı çıkarken macd indikatöründen gelen al sinyalı yapmak veya tersi tavsiye ederim
//@version=4
study("IIFSTOCH ve MACD", overlay=false, shorttitle="IIFSTOCH ve MACD")
wprlength=input(14,"Williams%R Length")
wmalength=input(9,"Smoothing Length")
wprs=0.1*(wpr(wprlength)+50)
wprsw=wma(wprs,wmalength)
INVWR=(exp(2*wprsw)-1)/(exp(2*wprsw)+1)
linecolor=#f39c12
plot(INVWR,color=linecolor, linewidth=1, title="%R")
obPlot=hline(0.9, color=color.black,title="Upper Band")
osPlot=hline(-0.9, color=color.black,title="Lower Band")
fill(obPlot,osPlot,color.black)
//alertcondition(INVWR, title="al", message="al")
// macd
fastLength = input(8, minval=1)
slowLength = input(16,minval=1)
signalLength=input(11,minval=1)
fastMA = ema(close, fastLength)
slowMA = ema(close, slowLength)
macd = fastMA - slowMA
signal = sma(macd, signalLength)
yukariKesermacd=crossover(macd, signal)
asagiKesermacd=crossunder(macd, signal)
//plotshape(yukariKesermacd,size=size.small,style=shape.labelup,location=location.bottom,text="AL")
//plotshape(asagiKesermacd,size=size.small,style=shape.labeldown,location=location.top,text="SAT")
//alertcondition(yukariKesermacd, title="AL", message="Al")
//alertcondition(asagiKesermacd, title="SAT", message="SAT")
alertcondition(INVWR and yukariKesermacd, title="Al", message="AL")
plotshape(INVWR and yukariKesermacd,size=size.small,style=shape.labelup,location=location.bottom,color=color.green,text="AL",textcolor=color.black)
alertcondition(INVWR and asagiKesermacd, title="SAT", message="SAT")
plotshape(INVWR and asagiKesermacd, size=size.small,style=shape.labeldown,location=location.top,color=color.red,text="SAT",textcolor=color.black)
fibonaaci ve parabolic sar kesişimleri tek bir alarm ileMerhabalar aşağıda vermiş olduğum pine script kodu fibonacci seviyelerinden
%0
%23,6
%38,,2
%50
%61,8
%78,6
%100
fibonaccci değerlerinde, parobolic sar indikatöründen de "buy" alarmı geldiği zaman tek bir alarm koyarak kesişimleri bulmaktadır.
// © ozgurhan
//@version=4
study(title="ozgurhan fibo-psar", shorttitle="ozgurhan fibo sar", overlay=true)
FPeriod = input(144, title="Fibo Period")
plotF1618 = input(title="Plot 1.618 Level?", type=input.bool, defval=false)
Fhigh = highest(FPeriod)
Flow = lowest(FPeriod)
FH = highestbars(high, FPeriod)
FL = lowestbars(low, FPeriod)
downfibo = FH < FL
F0 = downfibo ? Flow : Fhigh
F236 = downfibo ? (Fhigh - Flow) * 0.236 + Flow : Fhigh - (Fhigh - Flow) * 0.236
F382 = downfibo ? (Fhigh - Flow) * 0.382 + Flow : Fhigh - (Fhigh - Flow) * 0.382
F500 = downfibo ? (Fhigh - Flow) * 0.500 + Flow : Fhigh - (Fhigh - Flow) * 0.500
F618 = downfibo ? (Fhigh - Flow) * 0.618 + Flow : Fhigh - (Fhigh - Flow) * 0.618
F786 = downfibo ? (Fhigh - Flow) * 0.786 + Flow : Fhigh - (Fhigh - Flow) * 0.786
F1000 = downfibo ? (Fhigh - Flow) * 1.000 + Flow : Fhigh - (Fhigh - Flow) * 1.000
F1618 = downfibo ? (Fhigh - Flow) * 1.618 + Flow : Fhigh - (Fhigh - Flow) * 1.618
Fcolor = downfibo ? #00cc00 : #E41019
Foffset = downfibo ? FH : FL
plot(F0, color=Fcolor, linewidth=2, trackprice=true, show_last=1, title='0', transp=0)
plot(F236, color=Fcolor, linewidth=1, trackprice=true, show_last=1, title='0.236', transp=0)
plot(F382, color=Fcolor, linewidth=1, trackprice=true, show_last=1, title='0.382', transp=0)
plot(F500, color=Fcolor, linewidth=2, trackprice=true, show_last=1, title='0.5', transp=0)
plot(F618, color=Fcolor, linewidth=1, trackprice=true, show_last=1, title='0.618', transp=0)
plot(F786, color=Fcolor, linewidth=1, trackprice=true, show_last=1, title='0.786', transp=0)
plot(F1000, color=Fcolor, linewidth=2, trackprice=true, show_last=1, title='1', transp=0)
plot(plotF1618 and F1618 ? F1618 : na, color=Fcolor, linewidth=3, trackprice=true, show_last=1, title='1.618', transp=0)
plotshape(F0, style=shape.labeldown, location=location.absolute, color=Fcolor, textcolor=color.black, show_last=1, text="%0", offset=15, transp=30)
plotshape(F236, style=shape.labeldown, location=location.absolute, color=Fcolor, textcolor=color.black, show_last=1, text="%23.6", offset=15, transp=30)
plotshape(F382, style=shape.labeldown, location=location.absolute, color=Fcolor, textcolor=color.black, show_last=1, text="%38.2", offset=15, transp=30)
plotshape(F500, style=shape.labeldown, location=location.absolute, color=Fcolor, textcolor=color.black, show_last=1, text="%50", offset=15, transp=30)
plotshape(F618, style=shape.labeldown, location=location.absolute, color=Fcolor, textcolor=color.black, show_last=1, text="%61.8", offset=15, transp=30)
plotshape(F786, style=shape.labeldown, location=location.absolute, color=Fcolor, textcolor=color.black, show_last=1, text="%78.6", offset=15, transp=30)
plotshape(F1000, style=shape.labeldown, location=location.absolute, color=Fcolor, textcolor=color.black, show_last=1, text="%100", offset=15, transp=30)
plotshape(plotF1618 and F1618 ? F1618 : na, style=shape.labeldown, location=location.absolute, color=Fcolor, textcolor=color.black, show_last=1, text="%161.8", offset=15, transp=30)
plotshape(Flow, style=shape.labelup, location=location.absolute, size=size.large, color=color.yellow, textcolor=color.black, show_last=1, text="Low", offset=FL, transp=0)
plotshape(Fhigh, style=shape.labeldown, location=location.absolute, size=size.large, color=color.yellow, textcolor=color.black, show_last=1, text="High", offset=FH, transp=0)
//
start = input(title="Start", type=input.float, step=0.001, defval=0.02)
increment = input(title="Increment", type=input.float, step=0.001, defval=0.02)
maximum = input(title="Maximum", type=input.float, step=0.01, defval=0.2)
width = input(title="Point Width", type=input.integer, minval=1, defval=2)
highlightStartPoints = input(title="Highlight Start Points ?", type=input.bool, defval=true)
showLabels = input(title="Show Buy/Sell Labels ?", type=input.bool, defval=true)
highlightState = input(title="Highlight State ?", type=input.bool, defval=true)
psar = sar(start, increment, maximum)
dir = psar < close ? 1 : -1
psarColor = dir == 1 ? #3388bb : #fdcc02
psarPlot = plot(psar, title="PSAR", style=plot.style_circles, linewidth=width, color=psarColor, transp=0)
var color longColor = color.green
var color shortColor = color.red
buySignal = dir == 1 and dir == -1
plotshape(buySignal and highlightStartPoints ? psar : na, title="Long Start", location=location.absolute, style=shape.circle, size=size.tiny, color=longColor, transp=0)
plotshape(buySignal and showLabels ? psar : na, title="Buy Label", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=longColor, textcolor=color.white, transp=0)
midPricePlot = plot(ohlc4, title="", display=display.none)
fillColor = highlightState ? (dir == 1 ? longColor : shortColor) : na
fill(midPricePlot, psarPlot, title="Trade State Filling", color=fillColor)
alertcondition(((FH > FL and crossover(close, F236)) and (buySignal)) or ((FH > FL and crossover(close, F382)) and (buySignal)) or ((FH > FL and crossover(close, F500)) and (buySignal)) or ((FH > FL and crossover(close, F618)) and (buySignal)) or ((FH > FL and crossover(close, F786)) and (buySignal)) or ((FH < FL and crossover(close, 236)) and (buySignal)) or ((FH < FL and crossover(close, F382)) and (buySignal)) or ((FH < FL and crossover(close, F500)) and (buySignal)) or ((FH < FL and crossover(close, F618)) and (buySignal)) or ((FH < FL and crossover(close, F786)) and (buySignal)), title="fibo-Parabolic alarm", message="fibo-parabolic alarm")
Golden cross indikatörüMerhabalar, 50 günlük hareketli ortalamanın 200 günlük hareketli ortalamayı yukarı kesmesi durumuna golden cross denmektedir.
Aşağıda geliştirmiş olduğum pine script kodlarında ,golden cross durumunda indikatör hem al durumunda hem sat durumunda hemde alarm sayısından kazanmak için her iki durumda da alarm vermektedir.
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © ozgurhan
//@version=4
study("Hareketlii ortalama", overlay=true)
hizliPeriyot=input(50)
yavasPeriyot=input(200)
hizliMa=sma(close, hizliPeriyot)
yavasMa=sma(close, yavasPeriyot)
yukariKeser=crossover(hizliMa, yavasMa)
asagiKeser=crossunder(hizliMa, yavasMa)
kesisimRengi=(hizliMa>yavasMa ? color.green : color.red)
plotshape(yukariKeser, size=size.small, style=shape.labelup, location=location.belowbar, color=color.green, text="AL", textcolor=color.black)
plotshape(asagiKeser, size=size.small, style=shape.labeldown , location=location.abovebar, color=color.red, text="SAT", textcolor=color.black)
plot1=plot(hizliMa, color=color.blue, linewidth=3, title="HIZLI MA")
plot2=plot(yavasMa, color=color.orange, linewidth=3, title="YAVAŞ MA")
fill(plot1, plot2, color=kesisimRengi, transp=10)
yukselenTrendrengi=hizliMa>yavasMa
bgcolor(yukselenTrendrengi ? color.green : color.red)
barcolor(yukselenTrendrengi ? color.green : color.red)
alertcondition(yukariKeser, title="yukari kesti", message="yukarı keser")
alertcondition(asagiKeser, title="asagi kesti", message="asagi kesti")
alertcondition(asagiKeser or yukariKeser, title="asağı veya yukarı golden cross", message="asağı veya yukarı golden cross")
RSI 240 ve 50 değeriMerhabalar aşağıdaki pine script kodu rsi indikaörü 240 değerine ayarlanarak 50 değerini yukarı geçmesi ve 50 değerini aşağı kesmesi durumlarında alarm verecek şekilde ekleme yapılarak yazılmıştır.
Özellikle 1 saatlik grafiklerde 50 değerini yukarı kesmesi ve 50 değerini aşağı kesmesi durumlarında alış ve satış gelmesi muhtemeldir.
//@version=4
study(title="RSI 240", shorttitle="RSI", format=format.price, precision=2, resolution="")
len = input(240, minval=1, title="Length")
src = input(close, "Source", type = input.source)
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, "RSI", color=#7E57C2)
band1 = hline(70, "Upper Band", color=#787B86)
bandm = hline(50, "Middle Band", color=color.new(#787B86, 50))
band0 = hline(30, "Lower Band", color=#787B86)
fill(band1, band0, color=color.rgb(126, 87, 194, 90), title="Background")
alertcondition(rsi>50, title="RSI 50 'den büyük", message="RSI 50 'den büyük")
alertcondition(rsi<50, title="RSI 50 'den küçük", message="RSI 50 'den küçük")
alertcondition(rsi==50, title="RSI 50'ye eşit", message="RSI 50'ye eşit")
Trend ribbon indikatörüMerhbalar "trend ribbon indikatörünü" nde bazı düzenlemeler yaparak pine script kodlarını aşağıda veriyorum.
İndikatörde buy ve sell kısımlarını birleştirdim ki, tek bir alarm ile hem buy hem de sell alarmı geldiği zaman tek bir alarm ile (alarm geldi) işinizi görebilirsiniz.
İndikatörü 4 saatlik grafikte kullanmanızı tavsiye ederim.
//@version=4
study(title = "Trend ribbon", overlay = true)
//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
type = input(defval = "VWMA", options = , title = "MA Type")
len = input(20, minval = 5, title = "MA Length (min. 5)")
src1 = input(ohlc4, title = "MA Source")
src2 = input(ohlc4, title = "Signal Source")
showrib = input(true, title = "Show ribbon")
showbg = input(true, title = "Show color")
fromyear = input(1900, defval = 1900, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")
//MA
ma = type == "SMA" ? sma(src1, len) : type == "EMA" ? ema(src1, len) : type == "VWMA" ? vwma(src1, len) : rma(src1, len)
colorma = showrib ? color.black : na
pm = plot(ma, color = colorma, title = "MA")
//Price Channel
h = highest(ma, len)
l = lowest(ma, len)
colorpc = showrib ? color.blue : na
ph = plot(h, color = colorpc, title = "Upper line")
pl = plot(l, color = colorpc, title = "Lower Line")
//Trend
trend = 0
trend := src2 > h ? 1 : src2 < l ? -1 : trend
//BG
colorbg1 = showbg ? color.red : na
colorbg2 = showbg ? color.green : na
fill(ph, pm, color = colorbg1, transp = 50)
fill(pl, pm, color = colorbg2, transp = 50)
//Trading
truetime = time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)
LongSignal = trend == 1 and trend == -1 and needlong and truetime
ShortSignal = trend == -1 and trend == 1 and needshort and truetime
alertcondition(LongSignal, "Long Signal", 'Long Signal')
alertcondition(ShortSignal, "Sell Signal", 'Long Signal')
alertcondition(LongSignal or ShortSignal, title="alarm bulundu", message="alarm bulundu")
plotshape(LongSignal, title="Long",style=shape.labelup, text="Buy",location=location.belowbar, size=size.large, color=color.lime, textcolor=color.black, transp=0)
plotshape(ShortSignal, title="Short",style=shape.labeldown, text="Sell", location=location.abovebar, size=size.large, color=color.red, textcolor=color.black, transp=0)