안녕하세요. 운영자님
아래와 같은 트레이딩뷰 수식을 예스트레이더 수식으로 변환 부탁드립니다.
감사합니다.
//@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")
답변 1
예스스탁
예스스탁 답변
2023-03-15 15:09:05
안녕하세요
예스스탁입니다.
input : rsiLenghth(14),rsiOverBought(70),rsiOverSold(30);
var : bullishCandle(False),bearishCandle(False);
var : rsiValue(0),isRSIOB(False),isRSIOS(False);
var : tradeSignal(False);
bullishCandle=close >= open[1] and close[1] < open[1];
bearishCandle=close <= open[1] and close[1] >open[1];
rsiValue=rsi(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);
if tradeSignal and bullishCandle Then
Buy();
if tradeSignal and bearishCandle Then
Sell();
즐거운 하루되세요
> 고박사122 님이 쓴 글입니다.
> 제목 : 수식작성 부탁드립니다.
> 안녕하세요. 운영자님
아래와 같은 트레이딩뷰 수식을 예스트레이더 수식으로 변환 부탁드립니다.
감사합니다.
//@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")