0 beğenilme 0 beğenilmeme
215 kez görüntülendi

Öncelikle Merhaba,

Tradingview de kullanılan SuperTrend (everget) formülü var.

Benzerini Kıvanç ÖZBİLGİÇ yapmış. Size iki sorum olacak.

Birincisi Bu tredingviewdeki görünümü AL- SAT simgeleri ve ichumoku bulutuna benzer görüntüyü buna nasıl uygularız.

İkincisi Supertrend deki ATR Periyodu 22 , Multiplier i 3,5 kullanıyorum. Bu şekilde nasıl ayarlarım

Tradingview de kullanılan formül:

 

//@version=4
// Copyright (c) 2019-present, Alex Orekhov (everget)
// SuperTrend script may be freely distributed under the terms of the GPL-3.0 license.
study("SuperTrend", overlay=true)

length = input(title="ATR Period", type=input.integer, defval=22)
mult = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3)
src = input(title="Source", type=input.source, defval=hl2)
wicks = input(title="Take Wicks into Account ?", 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)

atr = mult * atr(length)

highPrice = wicks ? high : close
lowPrice = wicks ? low : close
doji4price = open == close and open == low and open == high

longStop = src - atr
longStopPrev = nz(longStop[1], longStop)

if longStop > 0
    if doji4price
        longStop := longStopPrev
    else
        longStop := (lowPrice[1] > longStopPrev ? max(longStop, longStopPrev) : longStop)
else
    longStop := longStopPrev

shortStop = src + atr
shortStopPrev = nz(shortStop[1], shortStop)

if shortStop > 0
    if doji4price
        shortStop := shortStopPrev
    else
        shortStop := (highPrice[1] < shortStopPrev ? min(shortStop, shortStopPrev) : shortStop)
else
    shortStop := shortStopPrev

var int dir = 1
dir :=
         dir == -1 and highPrice > shortStopPrev ? 1 :
         dir == 1 and lowPrice < longStopPrev ? -1 :
         dir

var color longColor = color.green
var color shortColor = color.red

longStopPlot = plot(dir == 1 ? longStop : na, title="Long Stop", style=plot.style_linebr, linewidth=2, color=longColor)
buySignal = dir == 1 and dir[1] == -1
plotshape(buySignal ? longStop : na, title="Long Stop Start", location=location.absolute, style=shape.circle, size=size.tiny, color=longColor, transp=0)
plotshape(buySignal and showLabels ? longStop : na, title="Buy Label", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=longColor, textcolor=color.white, transp=0)

shortStopPlot = plot(dir == 1 ? na : shortStop, title="Short Stop", style=plot.style_linebr, linewidth=2, color=shortColor)
sellSignal = dir == -1 and dir[1] == 1
plotshape(sellSignal ? shortStop : na, title="Short Stop Start", location=location.absolute, style=shape.circle, size=size.tiny, color=shortColor, transp=0)
plotshape(sellSignal and showLabels ? shortStop : na, title="Sell Label", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=shortColor, textcolor=color.white, transp=0)

midPricePlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0, display=display.none, editable=false)

longFillColor = highlightState ? (dir == 1 ? longColor : na) : na
shortFillColor = highlightState ? (dir == -1 ? shortColor : na) : na
fill(midPricePlot, longStopPlot, title="Long State Filling", color=longFillColor)
fill(midPricePlot, shortStopPlot, title="Short State Filling", color=shortFillColor)

changeCond = dir != dir[1]
alertcondition(changeCond, title="Alert: SuperTrend Direction Change", message="SuperTrend has changed direction!\nSymbol: {{exchange}}:{{ticker}}\nPrice: {{close}}")
alertcondition(buySignal, title="Alert: SuperTrend Buy", message="SuperTrend Buy!\nSymbol: {{exchange}}:{{ticker}}\nPrice: {{close}}")
alertcondition(sellSignal, title="Alert: SuperTrend Sell", message="SuperTrend Sell!\nSymbol: {{exchange}}:{{ticker}}\nPrice: {{close}}")

 

 

KIVANÇ ÖZBİLGİÇ in kullandığım formül:

period:=input("period",1,500,10);
coeff:=input("coeff",0,20,3);
AP:=(H+L)/2;
OFFSET:=coeff*ATR(period);
STR:=AP+OFFSET;
STS:=AP-OFFSET;
FUB:=IF(STR<PREV OR REF(C,-1)>PREV,STR,PREV);
FLB:=IF(STS>PREV OR REF(C,-1)<PREV,STS,PREV);
ST:=IF(PREV=REF(FUB,-1) AND C<FUB,FUB,IF(PREV=REF(FUB,-1) AND C>FUB,FLB,IF(PREV=REF(FLB,-1) AND C>FLB,FLB,IF(PREV=REF(FLB,-1) AND C<FLB,FUB,fub))));
ST

 

 

Grafik kategorisinde (20 puan) tarafından | 215 kez görüntülendi

2 Cevaplar

0 beğenilme 0 beğenilmeme
Merhabalar,

Aşağıdaki şekilde deneyebilirsiniz,

period:=input("period",1,500,22);
coeff:=input("coeff",0,20,3.5);
AP:=(H+L)/2;
OFFSET:=coeff*ATR(period);
STR:=AP+OFFSET;
STS:=AP-OFFSET;
FUB:=IF(STR<PREV OR REF(C,-1)>PREV,STR,PREV);
FLB:=IF(STS>PREV OR REF(C,-1)<PREV,STS,PREV);
ST:=IF(PREV=REF(FUB,-1) AND C<FUB,FUB,IF(PREV=REF(FUB,-1) AND C>FUB,FLB,IF(PREV=REF(FLB,-1) AND C>FLB,FLB,IF(PREV=REF(FLB,-1) AND C<FLB,FUB,fub))));
ST

bölgeli gösterimin yazılması pek mümkün gözükmemektedir.
(28,508 puan) tarafından
0 beğenilme 0 beğenilmeme
SET ATR_Period = 22
SET ATR_Multiplier = 3
SET HighPrice = H
SET LowPrice = L
SET ClosePrice = C
SET TR = MAX(HighPrice - LowPrice, ABS(HighPrice - REF(ClosePrice, 1)), ABS(LowPrice - REF(ClosePrice, 1)))
SET ATR = SMA(TR, ATR_Period)
SET UpLevel = (H + L) / 2 - ATR_Multiplier * ATR
SET DownLevel = (H + L) / 2 + ATR_Multiplier * ATR

SET Trend = IF(ClosePrice > DownLevel, 1, IF(ClosePrice < UpLevel, -1, PREV(Trend)))

SET BuySignal = CROSSOVER(ClosePrice, DownLevel)
SET SellSignal = CROSSUNDER(ClosePrice, UpLevel)

PLOT "SuperTrend" = IF(Trend == 1, DownLevel, UpLevel)
PLOT "Buy" = IF(BuySignal, LowPrice, NA)
PLOT "Sell" = IF(SellSignal, HighPrice, NA)
'İnsanların en hayırlısı insanlara en faydalı olanıdır'
(42 puan) tarafından
0 0

doganhayrullah Cevap için teşekkürler ama "Yazım Hatası" veriyor

"Yazım Hatası" veriyor
0 0

doganhayrullah Cevap için teşekkürler ama "Yazım Hatası" veriyor

Hoş geldiniz, Matriks Destek Platformu sizlere sorularınızın hızlıca cevaplanması için bir ortam sağlar. Sorduğunuz ve cevapladığınız soruların ve yorumlarınızın aldığı oylar üzerinden puan kazanırsınız. Puan sistemine bağlı kampanyamızla ücretsiz kullanım avantajlarından faydalanabilirsiniz.



8,391 soru
8,345 cevap
4,713 yorum
18,037 kullanıcı