답변완료
수식작성 부탁드립니다.
안녕하세요. 운영자님
아래와 같은 트레이딩뷰 수식을 예스트레이더 수식으로 변환 부탁드립니다.
감사합니다.
//@version=4
study("EngulfingCandle", overlay=true )
bullishCandle=close >= open[1] and close[1] < open[1] //and high >= high[1] and low <= low[1]
bearishCandle=close <= open[1] and close[1] >open[1] //and high > high[1] and low < low[1]
// RSI integration
rsiSource=input(title="rsiSource", defval=close, type=input.source)
rsiLenghth=input(title="rsi length", type=input.integer, defval=14)
rsiOverBought=input(title="rsi overbought level", type=input.integer, defval=70)
rsiOverSold=input(title="rsi over sold level", type=input.integer, defval=30)
//rsiOverBoughtThreshold=input(title="rsiOBThreshold level", type=input.integer, defval=97)
//rsiOverSoldThreshold=input(title="rsiOSThreshold level", type=input.integer, defval=18)
//get RSI value
rsiValue=rsi(rsiSource,rsiLenghth)
isRSIOB=rsiValue >= rsiOverBought and rsiValue
isRSIOS=rsiValue <= rsiOverSold and rsiValue
tradeSignal=((isRSIOS or isRSIOS[1] or isRSIOS[2]) and bullishCandle ) or ((isRSIOB or isRSIOB[1] or isRSIOB[2]) and bearishCandle)
//plot on chart
plotshape(tradeSignal and bullishCandle,title="bullish", location=location.belowbar, color=color.green,style=shape.triangleup, text="buy MIT")
plotshape(tradeSignal and bearishCandle,title="bearish", location=location.abovebar, color=color.red,style=shape.triangledown, text="sell MIT")
2023-03-15
1189
글번호 167179
시스템
답변완료
수식작성 부탁드립니다.
안녕하세요.
이번에 요청드릴 사항은 아래의 트레이딩 지표 2가지를 예스트레이더 형식으로 변환을 부탁드립니다. 감사합니다.
지표1)
//@version=3
study(title="GDAX EMA Cross[26,12]",shorttitle ="GDAX EMA", overlay=true)
short = ema(close, 12)
long = ema(close, 26)
plota = plot(short, color = #6f92ce, linewidth=2, title="Ema 12", editable = true)
plot(long, color = #e08937, linewidth=2, title="Ema 26", editable = true)
plot (cross(short, long) ? short : na, style = circles, color = red, linewidth = 4, title="Cross", trackprice = false)
trendup= long <= short
trendDn= long > short
emaUpColor() => trendup
emaDownColor() => trendDn
col = trendup ? blue : trendDn ? red : white
barcolor(emaUpColor() ? blue: emaDownColor() ? red : na, title="Highlights Trend")
지표2)
//@version=4
// this indicator gives you the angles of different moving averages
// this can give an indication of the momentum of a move increasing or decreasing
// you can also set a threshold for a minimum angle to filter out "no trade" zones
// JD.
// #NotTradingAdvice #DYOR
study("ma angles - JD")
src = input(ohlc4, title="source")
th = input(2, minval=1, title="threshold for -no trade zones- in degrees")
color_bars = input(false, title="color bars?")
no_trade = input(false, title="black out bars in no trade zones?")
// definition of "Jurik Moving Average", by Everget
jma(_src, _length, _phase, _power) =>
phaseRatio = _phase < -100 ? 0.5 : _phase > 100 ? 2.5 : _phase / 100 + 1.5
beta = 0.45 * (_length - 1) / (0.45 * (_length - 1) + 2)
alpha = pow(beta, _power)
jma = 0.0
e0 = 0.0
e0 := (1 - alpha) * _src + alpha * nz(e0[1])
e1 = 0.0
e1 := (_src - e0) * (1 - beta) + beta * nz(e1[1])
e2 = 0.0
e2 := (e0 + phaseRatio * e1 - nz(jma[1])) * pow(1 - alpha, 2) +
pow(alpha, 2) * nz(e2[1])
jma := e2 + nz(jma[1])
jma
//// //// Determine Angle by KyJ //// ////
angle(_src) =>
rad2degree = 180 / 3.14159265359 //pi
ang = rad2degree * atan((_src[0] - _src[1]) / atr(14))
ang
jma_line = jma(src, 10, 50, 1)
jma_line_fast = jma(src, 10, 50, 2)
ma27 = ema(src, 27)
ma83 = ema(src, 83)
ma278 = ema(src, 278)
jma_slope = angle(jma_line)
jma_fast_slope = angle(jma_line_fast)
ma27_slope = angle(ma27)
ma83_slope = angle(ma83)
ma278_slope = angle(ma278)
hline(0)
rising_1 = rising(ma27, 1)
color_1 = color.new(color.green, 75)
falling_1 = falling(ma27, 1)
plot(jma_slope, title="jma slope", style=plot.style_area, color=jma_slope >= 0 ? rising_1 ? color.green : color_1 : falling_1 ? color.red : color.maroon)
plot(jma_fast_slope, title="jma slope", style=plot.style_line, color=jma_fast_slope >= 0 ? color.green : color.red, transp=0)
plot(ma27_slope, title="ma27 slope filter", style=plot.style_area, color=abs(ma27_slope) > th ? na : color.yellow)
plot(ma83_slope, title="ma83 slope filter", style=plot.style_area, color=abs(ma83_slope) > th ? na : color.yellow)
plot(ma278_slope, title="ma278 slope filter", style=plot.style_area, color=abs(ma278_slope) > th ? na : color.yellow)
plot(ma27_slope, title="ma27 slope", style=plot.style_line, linewidth=2, color=ma27_slope >= 0 ? color.lime : color.fuchsia)
color_2 = color.new(color.green, 0)
color_3 = color.new(color.red, 0)
plot(ma83_slope, title="ma83 slope", style=plot.style_line, color=ma83_slope >= 0 ? color_2 : color_3)
plot(ma278_slope, title="ma278 slope", style=plot.style_line, color=ma278_slope >= 0 ? color.green : color.red)
plotshape(ma27_slope >= 0 ? ma27 : na, style=shape.triangleup, location=location.bottom, color=color.green)
plotshape(ma27_slope < 0 ? ma27 : na, style=shape.triangledown, location=location.top, color=color.red)
plotshape(ma27_slope >= 0 and not(ma27_slope[1] >= 0) ? ma27 : na, style=shape.triangleup, location=location.bottom, size=size.tiny, color=color.green)
plotshape(ma27_slope < 0 and not(ma27_slope[1] < 0) ? ma27 : na, style=shape.triangledown, location=location.top, size=size.tiny, color=color.red)
rising_2 = rising(ma27, 1)
falling_2 = falling(ma27, 1)
barcolor(color_bars ? no_trade and abs(ma27_slope) <= th ? color.white : jma_slope >= 0 ? rising_2 ? color.lime : color.green : falling_2 ? color.fuchsia : color.red : na)
2023-03-15
1884
글번호 167169
지표
답변완료
수식 문의드립니다
안녕하세요. 분할청산 관련해서 문의드립니다.
다음과 같은 식으로 4분할 청산을 하고 있습니다.
분할청산이 잘 되긴 하는데(PN풍년),
매수 후 익일에 청산이 나오면 분할매도가 안됩니다.(NICE)
어떻게 수정하면 되는지 문의드립니다.
감사합니다.
if MarketPosition == 1 Then {
if MaxEntries == 1 Then
{
ExitLong("ex1-1",AtLimit,AvgEntryPrice*1.1,"",floor(MaxContracts/4),1);
ExitLong("ex1-2",AtLimit,AvgEntryPrice*1.12,"",floor(MaxContracts/4),1);
ExitLong("ex1-3",AtLimit,AvgEntryPrice*1.14,"",floor(MaxContracts/4),1);
if H>=AvgEntryPrice*1.1 Then {ExitLong("당일청산1");}
}
}
2023-03-15
643
글번호 167167
시스템