답변완료
수식변환 부탁드립니다.
트레이딩뷰 수식을 예스로 변환하고자 합니다.
부탁드립니다.
//@version=5
indicator("EMA Crossover Signals with Engulfing Patterns and RSI Filter", overlay = true)
// Input settings
ema12Length = input.int(12, title="12 EMA Length")
ema26Length = input.int(26, title="26 EMA Length")
ema200Length = input.int(200, title="200 EMA Length")
rsiLength = input.int(14, title="RSI Length")
// EMA settings
ema12 = ta.ema(close, ema12Length)
ema26 = ta.ema(close, ema26Length)
ema200 = ta.ema(close, ema200Length)
// RSI settings
rsiValue = ta.rsi(close, rsiLength)
// Golden Cross for L ta.crossover(ema12, ema26)
l goldenCross and close > ema200
// Dead Cross for Short
deadCross = ta.crossunder(ema12, ema26)
shortC deadCross and close < ema200
// Bullish Engulfing Pattern with RSI Filter
bullishEngulfing = close[1] < open[1] and close > open and close > open[1] and open < close[1]
bullishC bullishEngulfing and rsiValue <= 35
// Bearish Engulfing Pattern with RSI Filter
bearishEngulfing = close[1] > open[1] and close < open and close < open[1] and open > close[1]
bearishC bearishEngulfing and rsiValue >= 65
// Plot buy and sell signals
plotshape(l"Buy Signal", location=locaticolor.green, style=shape.labelup, text="LONG")
plotshape(shortC"Sell Signal", location=locaticolor.red, style=shape.labeldown, text="SHORT")
// Plot Engulfing Patterns with RSI Filter
plotshape(bullishC"Bullish Engulfing", location=locaticolor.lime, style=shape.labelup, text="BULL")
plotshape(bearishC"Bearish Engulfing", location=locaticolor.maroshape.labeldown, text="BEAR")
// Plot EMAs
plot(ema12, title="12 EMA", color=color.blue)
plot(ema26, title="26 EMA", color=color.orange)
plot(ema200, title="200 EMA", color=color.purple)
2025-03-14
361
글번호 189172
지표
답변완료
파라볼릭 실쓰리
Input : af(0.02), maxAF(0.2);
Var : cSarv(0),T(0),tx(0),tx1(0),tx2(0);
var : LL(0),LL1(0),HH(0),HH1(0);
cSarv = csar(af,maxAF);
plot1(c);
If crossup(c,cSarv) Then
{
T = 1;
Text_Delete(tx2);
HH = H;
HH1 = HH[1];
var1 = cSarv;
}
If CrossDown(c,cSarv) Then
{
T = -1;
Text_Delete(tx1);
LL = L;
LL1 = LL[1];
var4 = csarv;
}
if T == 1 Then
{
if H > HH Then
HH = H;
Text_Delete(tx1);
if HH >= HH1-PriceScale*1 and HH <= HH1+PriceScale*1
and var4>= lowest(L,600)+0.8 and var4 >= highest(H,300)-0.1 Then
{
tx1 = Text_New(sDate,sTime,HH+0.2,"■");
Text_SetStyle(tx1,2,2);
Text_SetColor(tx1,Cyan);
Text_SetSize(tx1,45);
}
}
if T == -1 Then
{
if L < LL Then
LL = L;
Text_Delete(tx2);
if LL <= LL1+PriceScale*1 and LL >= LL1-PriceScale*1
and var1<= highest(H,1000)-0.8 and var1<= lowest(L,500)+0.1 Then
{
tx2 = Text_New(sDate,sTime,LL-0.2,"■");
Text_SetStyle(tx2,2,2);
Text_SetColor(tx2,Lime);
Text_SetSize(tx2,45);
}
}
1.수정
max,min을 이용해 수식 단순화가 가능하면, 쌍바닥 가능 네모를 1틱 이내일 때 표시로 수정.
아래로 벗어나거나 양전환되면 삭제.
쌍봉은 반대.
2.추가
세 저점이 2틱 이내에 들어오면 (2틱내 쓰리바닥 가능 지점) 세로선 추가.
2틱 이내를 아래로 하향 돌파하면 세로선 삭제.
그전에 양전환되면 삭제.
세 고점이 2틱 이내에 들어오면 (2틱내 쓰리봉 가능 지점) 세로선 추가.
2틱 이내를 위로 상향 돌파하면 세로선 삭제.
그전에 음전환되면 삭제. 감사합니다.
2025-03-14
348
글번호 189165
지표
답변완료
문의 드립니다.
input : fib1(1.618);
input : fib2(2.618);
input : dev(150);
var : debut(False);
var : addsource(0),addvol(0),VWAP(0),sn(0),sd(0);
var : Fibp2(0),Fibp1(0),Fibm1(0),Fibm2(0),tx(0);
debut = DayOfWeek(Bdate) < DayOfWeek(Bdate[1]);
addsource = (h+l+c)/3 * volume;
addvol = volume;
if debut == true Then
{
var1 = addsource;
var2 = addvol;
}
Else
{
var1 = var1 + addsource;
var2 = var2 + addvol;
}
VWAP = var1/var2;
if debut Then
sn = 0;
sn = iff(debut , sn , sn[1] + volume * ((h+l+c)/3 - VWAP[1]) * ((h+l+c)/3 - VWAP));
sd = sqrt(sn / addvol);
Fibp2 = VWAP + fib2 * sd;
Fibp1 = VWAP + fib1 * sd;
Fibm1 = VWAP - fib1 * sd;
Fibm2 = VWAP - fib2 * sd;
plot1(VWAP, "VWAP",orange);
plot2(Fibp2,"Fibp2",red);
plot3(Fibp1,"Fibp1",red);
plot4(Fibm1,"Fibm1",lime);
plot5(Fibm2,"Fibm2",lime);
var : bull(False),bear(False);
bull = CrossDown(low[1],Fibm1[1]) and low[1]>=Fibm2[1] and low>Fibm2 and low<Fibm1 and sd>dev;
bear = CrossUp(high[1],Fibp1[1]) and high[1]<=Fibp2[1] and high<Fibp2 and high>Fibp1 and sd>dev;
if bull == true Then
{
tx = Text_New(sDate,sTime,L,"▲");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,Red);
Text_SetSize(tx,20);
}
if bear == true Then
{
tx = Text_New(sDate,sTime,H,"▼");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Blue);
Text_SetSize(tx,20);
}
위 지표를 사용하면 올린 이미지처럼 나옵니다.
캔들이 정상적으로 나오게 하려면 어떻게 해야 되나요?
2025-03-14
358
글번호 189160
지표
답변완료
재 문의 드립니다.
안녕하세요
항상 감사합니다.
보내주신 아래의 서식을 주식선물이나 지수선물에도 적용할 수 있도록 매도전략도 넣어주시길 부탁드립니다. 10만주 이상 거래량은 없애주세요
매수: 최근 200일 고점 돌파시 매수
매도: 최근 200일 저점 돌파시 매도
청산: 2ATR
input : P(10),n(2);
if h > highest(h,200)[1] and v[1] >= 1000000 Then
Buy();
if MarketPosition == 1 Then
{
ExitLong("bp",AtLimit,EntryPrice+ATR(P)*n);
ExitLong("bl",AtStop,EntryPrice-ATR(P)*n);
}
2025-03-14
375
글번호 189158
지표