답변완료
수식 수정
A식
input : EmaPeriod(80);
input : RSIPeriod1(7),RSIPeriod2(14),RSIPeriod3(21),RSI차이(7);
input : ADXPeriod(20);
input : 익절(50),손절(50);
var : Emav(0,Data1),RSI1(0,Data1),RSI2(0,Data1),RSI3(0,Data1),ADXv(0,Data1);
var : Bcond(False,Data1),Scond(False,Data1);
Input : 당일수익틱수(200);
Var : N1(0,Data1),dayPl(0,Data1),당일수익(0,Data1);
var : Tcond(false,Data1),Xcond(false,Data1);
if Bdate != Bdate[1] Then
{
Xcond = False;
}
당일수익 = data1(PriceScale*당일수익틱수);
if Bdate != Bdate[1] Then
{
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true) then
Xcond = true;
}
Emav = data1(Ema(C,EmaPeriod));
RSI1 = data1(RSI(RSIPeriod1));
RSI2 = data1(RSI(RSIPeriod2));
RSI3 = data1(RSI(RSIPeriod3));
ADXv = data1(ADX(ADXperiod));
Bcond = MarketPosition == 0 and MarketPosition(1) == 1 and MarketPosition(2) == 1;
Scond = MarketPosition == 0 and MarketPosition(1) == -1 and MarketPosition(2) == -1;
if Xcond == false then
{
if C > Emav and
RSI1 >= RSI2+RSI차이 and RSI2 >= RSI3+RSI차이 and
ADXV >= 21 and
Bcond == False and
Data2(ma(C,60) > ma(C,10)) Then
buy();
if C < Emav and
RSI1 <= RSI2-RSI차이 and RSI2 <= RSI3-RSI차이 and
ADXV >= 21 and
Scond == False and
Data2(ma(C,60) < ma(C,10)) Then
Sell();
}
if MarketPosition == 1 then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
}
if MarketPosition == -1 then
{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
}
b식
Inputs : Period(20), Sence(1.5), CC_DN(Yellow);
Vars:
VLineUp(0),
VLineDn(0),
HHighest(0),
LLowest(0),
JustChanged(FALSE),
VLine(0), DBN(0),T(0);
Array:
Highs[35](0),
Lows[35](0),
RRange[35](0),
UpWave[1](FALSE),
DnWave[1](FALSE);
If STime == 180000 Then
DBN = 0;
DBN = DBN + 1;
Var1 = Period;
Var2 = Var1 - 1;
Var3 = Var1 - 2;
Var5 = Sence;
Var6 = H-L;
JustChanged = FALSE;
if CurrentBar <= Var2 then begin
Highs[CurrentBar] = Close;
Lows[CurrentBar] = Close;
RRange[CurrentBar] = (H-L) /2;
end;
if CurrentBar == Var1 then begin
if Highs[Var2] >= Highs[Var3] then begin
UpWave[1] = TRUE;
HHighest = Highs[Var2];
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
#Plot1(VLineUp,"VLineUp");
end;
if Highs[Var2] < Highs[Var3] then begin
DnWave[1] = TRUE;
LLowest = Lows[Var2];
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
#Plot2(VLineDn,"VLineDn");
end;
end;
if CurrentBar > Var1 then begin
if DnWave[1] and Close > VLineDn then begin
DnWave[1] = FALSE;
UpWave[1] = TRUE;
JustChanged = TRUE;
HHighest = Close;
LLowest = 0;
end;
if UpWave[1] and Close < VLineUp and JustChanged == FALSE then begin
UpWave[1] = FALSE;
DnWave[1] = TRUE;
JustChanged = TRUE;
LLowest = Close;
HHighest = 0;
end;
if JustChanged == FALSE then begin
if Close > HHighest then
HHighest = Close;
else if Close < LLowest then
LLowest = Close;
end;
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
if UpWave[1] then
T = 1;
else if DnWave[1] then
T = -1;
end;
Input : BBP(20), MultiD(2),P(30);
var : BBmd(0),BBup(0),BBdn(0),mav(0);
BBmd = ma(C,Period);
BBup = BollBandUp(BBP,MultiD);
BBdn = BollBandDown(BBP,MultiD);
mav = ma(C,P);
if CrossDown(C,BBup) and t == -1 and c > mav Then
sell();
if crossup(C,BBdn) and t == 1 and c < mav Then
buy();
안녕하세요 두식이 같은방향으로 신호시 진입하도록 수정부탁드림니다.
수식 A+B
위 두식이 일치할때 진입.
A식이 신호발생 상태에서 B식이 같은방향으로 신호시 진입
2025-03-14
316
글번호 189174
시스템
답변완료
수식변환 부탁드립니다.
트레이딩뷰 수식을 예스로 변환하고자 합니다.
부탁드립니다.
//@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
338
글번호 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
326
글번호 189165
지표