예스스탁
예스스탁 답변
2023-06-23 11:50:34
안녕하세요
예스스탁입니다.
input : rsiLenghth(14);
input : rsiOverBought(70);
input : rsiOverSold(30);
var : bullishCandle(False),bearishCandle(False);
var : rsiValue(0),isRSIOB(False),isRSIOS(False),tradeSignal(False);
var : tx1(0),tx2(0);
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]
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
{
tx1 = Text_New(sDate,sTime,L,"▲");
tx2 = Text_New(sDate,sTime,L,NewLine+"bullish");
Text_SetStyle(tx1,2,0);
Text_SetStyle(tx2,2,0);
Text_SetColor(tx1,Green);
Text_SetColor(tx2,Green);
}
if tradeSignal and bearishCandle Then
{
tx1 = Text_New(sDate,sTime,H,"▼");
tx2 = Text_New(sDate,sTime,H,"bearish"+NewLine);
Text_SetStyle(tx1,2,1);
Text_SetStyle(tx2,2,1);
Text_SetColor(tx1,Red);
Text_SetColor(tx2,Red);
}
즐거운 하루되세요
> 고박사122 님이 쓴 글입니다.
> 제목 : 수식작성 부탁드립니다.
> 안녕하세요. 운영자님
아래와 같은 트레이딩뷰 수식을 예스트레이더 수식으로 변환 부탁드립니다.
감사합니다
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ahmedirshad419
//@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")