답변완료
검색식 확인부탁드립니다. _(_ _)_
한결같은 도와주심에 감사드립니다. _(__)_
도움주신 엔벨로프관련 두 수식이 신호가 안잡히거나 나왔는데 다음날 또 나오는 종목이
있는데 확인 좀 부탁드립니다.
예시차트2개를 첨부합니다. 1은 안잡힌 종목차트, 2는 엔벨로프 안착이후 또 잡히는 종목
입니다. 예시는 수식1차트지만 수식2도 동일한 현상이 나옵니다.
수식1
input : Period(20),percent(10);
var1 = macd(12,26);
var2 = Sar(0.02,0.2);
Var3 = EnvelopeDown(Period,Percent);
if CountIf(Condition1,30) >= 1 and
C > Var3 and L[1] < Var3[1] Then
find(1);
Condition1 = var1 >= 0 and CrossUp(c,Var2) and C >= C[1]*1.03 and C > O;
수식2
var : MM(0),KK(0),MO(0),mx(0);
var : M1(0),M2(0),M3(0),M4(0),M5(0),M6(0);
var : M7(0),M8(0),M9(0),M10(0),M11(0),M12(0);
MM = floor(date/100);
if MM != MM[1] Then
{
MO = O;
M1 = KK[1];
M2 = M1[1];
M3 = M2[1];
M4 = M3[1];
M5 = M4[1];
M6 = M5[1];
M7 = M6[1];
M8 = M7[1];
M9 = M8[1];
M10 = M9[1];
M11 = M10[1];
M12 = M11[1];
mx = Max(M1, M2, M3, M4, M5,M6, M7, M8, M9, M10, M11, M12);
}
KK = iff(MO > C, MO, 0);
var1 = EnvelopeDown(20,10);
if CountIf(Condition1,30) >= 1 and C > var1 and L[1] < var1[1] Then
Find(1);
Condition1 = mx > 0 and CrossUp(C,mx);
2024-04-25
788
글번호 178919
종목검색
답변완료
수정 부탁드립니다.
{
var2 = Sarv+(AF_value)*(EP-SAR_Value);
if MarketPosition == 0 and MarketPosition(1) == 1 and
#IsEntryName("b1",1) == true and
IsExitName("bx",1) == true and
Direction == -1 and
CountIf(MC <= 0,BarsSinceExit(1)) < 1 and
mc > 0 Then
Buy("b2",AtStop,Var2);
if MarketPosition == 0 and MarketPosition(1) == -1 and
#IsEntryName("s1",1) == true and
IsExitName("sx",1) == true and
Direction == 1 and
CountIf(MC >= 0,BarsSinceExit(1)) < 1 and
mc < 0 Then
Sell("s2",AtStop,Var2);
if MarketPosition == 1 and Direction == 1 Then
ExitLong("bx",AtStop,var2);
if MarketPosition == -1 and Direction == -1 Then
ExitShort("sx",AtStop,var2);
}
input : 최소수익포인트(20),하락률(10);
if MarketPosition == 1 Then
{
if highest(H,BarsSinceEntry) >= EntryPrice+최소수익포인트 Then
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*(하락률/100));
}
if MarketPosition == -1 Then
{
if lowest(L,BarsSinceEntry) <= EntryPrice-최소수익포인트 Then
ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+(EntryPrice-lowest(L,BarsSinceEntry))*(하락률/100));
}
위에 처럼 최대수익대비 하락 청산 수식을 만들어 주셔서 기존 수식에 붙여넣어서 검증하니
"bx"와 "SX" 가 이미 선언되어 있습니다. 라고 검증오류가 나오네요... 수정 좀 부탁드립니다.
2024-04-25
1042
글번호 178916
시스템
답변완료
다른 지표를
다른 지표를 예스트레이더에 이식해 볼려고 하는데 안되는 부분이 있어서 그냥 통째로 올려봅니다.
length = input(10, minval=1, title="BB Periods")
dev = input(1, minval=0.0001, title="Deviations")
//MACD
fastLength = input(12, minval=1)
slowLength=input(26,minval=1)
signalLength=input(9,minval=1)
fastMA = ema(close, fastLength)
slowMA = ema(close, slowLength)
macd = fastMA - slowMA
//BollingerBands
Std = stdev(macd, length)
Upper = (Std * dev + (sma(macd, length)))
Lower = ((sma(macd, length)) - (Std * dev))
Band1 = plot(Upper, color=gray, style=line, linewidth=2,title="Upper Band")
Band2 = plot(Lower, color=gray, style=line, linewidth=2,title="lower Band")
fill(Band1, Band2, color=blue, transp=75,title="Fill")
mc = macd >= Upper ? lime:red
// Indicator
plot(macd, color=mc, style =circles,linewidth = 3)
zeroline = 0
plot(zeroline,color= orange,linewidth= 2,title="Zeroline")
//buy
barcolor(macd >Upper ? yellow:na)
//short
barcolor(macd <Lower ? aqua:na)
첨부한 그림처럼 지표로 나오면 좋을 듯 합니다.
수고하세요.. 감사합니다.
2024-04-25
1114
글번호 178901
지표