답변완료
수식부탁드립니다
수식부탁드립니다.
매수와 청산식은 아래와 같고 하루 한번만 진입합니다
if countif(marketposition==0 && crossup(c,ma(c,5)) && dayindex()>0, dayindex())==1 &&
marketposition==0 && crossup(c,ma(c,5)) && dayindex()>0 then buy();
if marketposition==1 && crossdown(c,ma(c,5)) && dayindex()>0 then exitlong();
위와 동일한 식을 참조종목에 적용하고
본봉목의 수익과 참조종목의 수익의 합이 30틱이면 본종목을 청산할수 있도록
수식부탁드립니다.
2024-01-23
1179
글번호 176017
시스템
답변완료
수식수정
Input : Period(60), MultiD(2);
var : MAv(0),BBup(0),BBdn(0),T(0);
MAv = ma(C,Period);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
if CrossUp(c,mav) Then
T = 1;
if CrossDown(c,mav) Then
T = -1;
if T == -1 and abs(mav-bbdn) <= PriceScale*10 Then
{
if NextBarOpen < mav Then
Buy("b1",AtStop,mav);
if C > C[1] Then
Buy("b2");
}
if T == 1 and abs(mav-bbdn) <= PriceScale*10 Then
{
if NextBarOpen > mav Then
Sell("s1",AtStop,mav);
if C < C[1] Then
Sell("s2");
}
85500글입니다
lnput
볼밴20.2
이평 60
이평선과 볼밴선 폭 10틱이내.
매수
가격이 60이평선을 하락이나 터치후
60이평을 돌파상승시
첫양봉에서 진입
조건 이평 60선과 볼밴하단선이 -+ 10틱이내일때.
이평60선과 볼밴하단선폭이 반드시 조건에 들때진입
청산및손절
가격이
60이평을 가격이돌파하락시.
매도
가격이 60이평선을 돌파상승이나 터치후
60이평선 아래로 하락시 첫음봉에서 진입
청산 60이평선을 가격이 돌파상승시.
2024-01-24
797
글번호 176009
시스템
답변완료
시스템식 부탁드립니다.
항상 도움 주셔서 감사합니다.
아래 시스템식에서 불타기의 청산조건을
마지막 진입가격 대비 outgap(20) 만큼 하락시 청산하는
조건으로 시스템식 변경 부탁드립니다.
감사합니다.
input : Pst(1);
input : gap(20), outgap(20), gapmulti(0.7), multi(0.7), pt(20), sl(200);
var : vol(0),v1(0),t(0),b(0),s(0);
var : line1(0), line2(0);
value1 = gap/PointValue;
value2 = pt/PointValue;
value3 = sl/PointValue;
value4 = outgap/PointValue;
line1 = ma(c,10) ;
line2 = ma(c,20) ;
if pst == 1 Then
{
if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
vol = 1;
Buy("b",OnClose,Def,vol);
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
v1 = CurrentContracts-CurrentContracts[1];
if MaxEntries == 1 Then
t = value1 ;
Else
t = t+Round(t*gapmulti,0);
if LatestEntryName(0) == "upb" Then
b = 1;
if LatestEntryName(0) == "dnb" Then
b = -1;
}
vol = Round(v1+v1*multi,0);
Buy("dnb",AtLimit,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol);
Buy("upb",AtStop,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol);
if b == -1 Then
{
ExitLong("bx11",AtLimit,AvgEntryPrice+PriceScale*Value2);
ExitLong("bx12",AtLimit,EntryPrice);
}
if b == 1 Then
{
ExitLong("bx21",AtStop,AvgEntryPrice-PriceScale*Value2);
ExitLong("bx22",AtStop,EntryPrice);
}
}
Else
b = 0;
}
if pst == -1 Then
{
if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
vol = 1;
Sell("s",OnClose,Def,vol);
}
if MarketPosition == -1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
v1 = CurrentContracts-CurrentContracts[1];
if MaxEntries == 1 Then
t = value1 ;
Else
t = t+Round(t*gapmulti,0);
if LatestEntryName(0) == "ups" Then
s = 1;
if LatestEntryName(0) == "dns" Then
s = -1;
}
vol = Round(v1+v1*multi,0);
Sell("ups",AtLimit,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol);
Sell("dns",AtStop,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol);
if s == 1 Then
{
ExitShort("sx11",AtLimit,AvgEntryPrice-PriceScale*Value2);
ExitShort("sx12",AtLimit,EntryPrice);
}
if s == -1 Then
{
ExitShort("sx21",AtStop,AvgEntryPrice+PriceScale*Value2);
ExitShort("sx22",AtStop,EntryPrice);
}
}
Else
s = 0;
}
2024-01-23
805
글번호 175979
시스템
답변완료
문의드립니다.
다음 수식을 종목검색식으로 부탁드립니다.
(1)
A1 = (npredayclose(20)+npredayclose(19)+npredayclose(18)+npredayclose(17)+npredayclose(16)+npredayclose(15)+npredayclose(14)+npredayclose(13)+npredayclose(12)+npredayclose(11)+npredayclose(10)+npredayclose(9)+npredayclose(8)+npredayclose(7)+npredayclose(6)+npredayclose(5)+npredayclose(4)+npredayclose(3)+npredayclose(2)+npredayclose(1))/20;
B = ma(C, 20);
D = CrossDown(B, ,A1);
K = Valuewhen(1, D, (A1+C)/2);
CrossUp(C, K)
(2)
A = ma(C, 5);
B = ma(C, 20);
An= CrossDown(A, B);
k1 = Valuewhen(1, An, (C+ B)/2);
CrossUp(C, K1)
(3)
period 5
period1 10
period2 20
period3 60
percent 0.7
mult 1.1
prv 100
k1=avg(c,period);
k2=avg(c,period1);
k3=avg(c,period2);
k4=avg(c,period3);
k5=k1/k3*100;
k6=EnvelopeUp(Period,Percent);
CrossUp(c,k6) && c>k3 && c>k4 &&
k3>k4 && c>o && c>c(1)*mult &&
c>h(1) &&( k5(1)<prv or k5(2)<prv or
k5(3)<prv or k5(4 )<prv or
k5(5)<prv )
2024-01-22
871
글번호 175964
종목검색
답변완료
수식작성 부탁드립니다.
안녕하세요. 운영자님
이번에 꼭좀 부탁드릴 사항은 다음의 트레이딩뷰 지표를 예스트레이더로 변환을 해주십사합니다.
//@version=4
study(title="Twin Range Filter", overlay=true)
source = input(defval=close, title="Source")
// Smooth Average Range
per1 = input(defval=27, minval=1, title="Fast period")
mult1 = input(defval=1.6, minval=0.1, title="Fast range")
per2 = input(defval=55, minval=1, title="Slow period")
mult2 = input(defval=2, minval=0.1, title="Slow range")
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ema(abs(x - x[1]), t)
smoothrng = ema(avrng, wper) * m
smoothrng
smrng1 = smoothrng(source, per1, mult1)
smrng2 = smoothrng(source, per2, mult2)
smrng = (smrng1 + smrng2) / 2
// Range Filter
rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r :
x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r
rngfilt
filt = rngfilt(source, smrng)
upward = 0.0
upward := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1])
downward = 0.0
downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 : nz(downward[1])
hband = filt + smrng
lband = filt - smrng
longCond = bool(na)
shortCond = bool(na)
longCond := source > filt and source > source[1] and upward > 0 or source > filt and source < source[1] and upward > 0
shortCond := source < filt and source < source[1] and downward > 0 or source < filt and source > source[1] and downward > 0
CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
long = longCond and CondIni[1] == -1
short = shortCond and CondIni[1] == 1
// Plotting
plotshape(long, title="Long", text="Long", style=shape.labelup, textcolor=color.black, size=size.tiny, location=location.belowbar, color=color.lime, transp=0)
plotshape(short, title="Short", text="Short", style=shape.labeldown, textcolor=color.white, size=size.tiny, location=location.abovebar, color=color.red, transp=0)
// Alerts
alertcondition(long, title="Long", message="Long")
alertcondition(short, title="Short", message="Short")
2024-01-22
1142
글번호 175962
지표