답변완료
부탁드립니다.
감사드립니다.
마지막 청산된 (StopLoss, StopTrailing) 봉 위에 표시되게 요청드립니다.
모든 청산된 (StopLoss, StopTrailing) 봉 위에 표시되게 하는 방법도 설명 부탁드립니다.
차트 마지막봉 위에 표시되게 작성해 드립니다.
input : 손절(20),익절(15),익절하락(3);
input : P1(30), P2(120), p3(240);
input : StartTime(090000),EndTime(050000);
var : tt(0),tx(0),X(false),tx1(0),cnt(0),sum(0);
var: Tcond(false),ht(0),lcnt(0),trcnt(0),R(-1);
Array : XX[200](-1);
var1 = ma(C, P1);
var2 = ma(C, P2);
var3 = ma(C, P3);
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
tt = 0;
X = false;
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = false;
if MarketPosition == 1 Then
{
ExitLong("BE6");
}
if MarketPosition == -1 Then
{
ExitShort("SE6");
}
}
if Tcond == true then
{
if marketposition == 0 and crossup(var1,var2) Then {
buy("B1");
}
if marketposition == 0 and crossdown(var1,var2) Then {
sell("S1");
}
if marketposition == 0 and crossup(var2,var3) and var3[1] < var3 Then {
buy("B2");
}
if marketposition == 0 and crossdown(var3,var4) and var3[1] > var3 Then {
sell("S2");
}
## 청산
if MarketPosition == 1 then
{
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
if MarketPosition == -1 Then
{
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
}
## 카운트 (수정요청)
if TotalTrades > TotalTrades[1] then
{
if IsExitName("StopLoss",1) == true then
{
lcnt = lcnt+1;
XX[0] = 0;
for cnt = 1 to 199
{
XX[cnt] = XX[cnt-1][1];
}
if Floor((trcnt+lcnt)*0.2) > 1 then
{
sum = 0;
for cnt = 0 to Floor((trcnt+lcnt)*0.2)-1
{
if XX[cnt] == 1 Then
sum = sum+1;
}
R = sum/Floor((trcnt+lcnt)*0.2)*100;
}
tt = tt +1 ;
if tt > ht Then
{
ht = tt;
}
tx = Text_New(ExitDate(1),ExitTime(1),h[BarsSinceExit(1)],NumToStr(ht,0)+"◆");
Text_SetSize(tx,20);
Text_Setstyle(tx,2,1);
Text_SetColor(tx,GREEN);
}
if IsExitName("StopTrailing",1) == true then
{
trcnt = trcnt+1;
XX[0] = 1;
for cnt = 1 to 199
{
XX[cnt] = XX[cnt-1][1];
}
if Floor((trcnt+lcnt)*0.2) > 1 then
{
sum = 0;
for cnt = 0 to Floor((trcnt+lcnt)*0.2)-1
{
if XX[cnt] == 1 Then
sum = sum+1;
}
R = sum/Floor((trcnt+lcnt)*0.2)*100;
}
tt = tt + 1;
ht = tt;
tx = Text_New(ExitDate(1),ExitTime(1),h[BarsSinceExit(1)],NumToStr(ht,0)+"◆");
Text_SetSize(tx,20);
Text_Setstyle(tx,2,1);
Text_SetColor(tx,GREEN);
}
}
Text_Delete(tx1);
tx1 = Text_New(NextBarSdate,NextBarStime,H,NumToStr(trcnt/(trcnt+lcnt)*100,1)+NewLine+NumToStr(R,1));
Text_SetStyle(tx1,0,1);
2020-04-09
888
글번호 137751
시스템
답변완료
안녕 하세요
안녕하세요.
시스템식 다시 부탁해요
4개의 시스템식을 하나의 식으로 부탁 함니다
(A or B) and (C or D) 로 원했는데 답변결과는(A or B) or (C or D) 인것 같아요
다시 잘 검토해서 (A or B) and (C or D) 해주시기 바람니다.
감사함니다
예스스탁 답변식입니다
Input : shortPeriod1(5), longPeriod1(20);
Input : shortPeriod2(10), longPeriod2(30);
Input : shortPeriod3(20), longPeriod3(30);
input : shortPeriod4(20), longPeriod4(30);
value1 = ma(C, shortPeriod1);
value2 = ma(C, longPeriod1);
value3 = ma(C, shortPeriod2);
value4 = ma(C, longPeriod2);
value5 = ema(C, shortPeriod3);
value6 = ema(C, longPeriod3);
value7 = ema(C, shortPeriod4);
value8 = ema(C, longPeriod4);
if (crossup(value1,value2) or crossup(value3,value4)) or
(crossup(value5,value6) or crossup(value7,value8)) Then
buy();
if (CrossDown(value1,value2) or CrossDown(value3,value4)) or
(CrossDown(value5,value6) or CrossDown(value7,value8)) Then
sell();
A식
Input : shortPeriod(5), longPeriod(20);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
Sell();
}
B식
Input : shortPeriod(10), longPeriod(30);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
Sell();
}
C식
Input : shortPeriod(20), longPeriod(30);
value1 = ema(C, shortPeriod);
value2 = ema(C, longPeriod);
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
Sell();
}
D식
Input : shortPeriod(20), longPeriod(30);
value1 = ema(C, shortPeriod);
value2 = ema(C, longPeriod);
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
Sell();
}
2020-04-09
853
글번호 137742
시스템
답변완료
수식 부탁 드립니다
키움 수식입니다 예스로 전환 부탁 드립니다
수식1
a=ma(sum(((c*4) - ((h+l) + (((h(1)+l(1))))))*v),2,지수이평);
b=ma(a,20,단순이평);
f = ma(종가,20,지수이평)-ma(종가,50,지수이평);
s= ma(f,9,지수이평);
if(a>b, if(s<f, 100,65), if(s>f, 0,35));
색상은 위와 같이 보이게 했으면 합니다
2020-04-08
1059
글번호 137734
지표
답변완료
수식 부탁 드립니다
수고 하십니다
키움 수식인데 예스차트로 변환 부탁 드립니다
수식 1 매도
highestsince(1,CrossUp(avg(c,2),avg(c,10)),avg(c,10))
수식 2 매수
lowestsince(1,Crossdown(avg(c,2),avg(c,10)),avg(c,10))
수식 3 20선
avg(c,20)
라인
매도 원
매수 원
20선 선
으로 표시 되었으면 합니다
2020-04-08
1304
글번호 137732
지표
답변완료
수식전환 부탁드립니다.
예스 지표로 수식전환 부탁요
{1}
length=input(20), siglength=input(9)
colorBars=input(false, title="Color bars?")
ma(s,l) => ema(s,l)
mao=ma(open, length), mac =ma(close, length)
mc=mac-mao, mo=mao-mac, signal=sma(mc, siglength)
plot(0, title="ZeroLine", color=gray)
plot(mc, color=green, linewidth=2, style=histogram,title="BullHisto")
plot(mo, color=red, linewidth=2, style=histogram,title="BearHisto")
plot(mo, color=red, linewidth=2,title="BearLine")
plot(mc, color=green, linewidth=2,title="BullLine")
plot(signal, color=blue, linewidth=2,title="Signal")
us=max(mc,mo), bc=us>=signal?(us==mc?lime:maroon):na
barcolor(colorBars?bc:na)
{2}
// Notes: { RS-MACD
// @author - RicardoSantos
// Indicator - Moving Average Convergence/Divergence "MACD"
// Notes - the only diference is the color switch and visual aspect.
// }
source = ohlc4
fastLength = input(12, minval=1), slowLength=input(24,minval=1)
signalLength=input(6,minval=1)
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
macd = fastMA - slowMA
signal = sma(macd, signalLength)
hist = macd - signal
c1 = macd > signal and macd >= macd[1] ? green : #fda8a8
c2 = signal > macd and signal <= signal[1] ? red : #a8fdab
p0 = hline(0, color=black, linewidth=1)
p1 = plot(hist, style=area, color=teal, transp=80, linewidth=2, title="Histogram")
p2 = plot(macd, color=c1, style=circles, linewidth=2, join=true, title="MACD")
p3 = plot(signal, color=c2, style=circles, linewidth=2, join=true, title="Signal")
2020-04-08
1276
글번호 137730
지표
답변완료
문의드립니다
input : ntime1(60),P(20);
var : S1(0),D1(0),TM(0),TF(0),cnt(0),TL1(0),TL2(0);
Array : HH[10](0),LL[10](0),CC[10](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%ntime1;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
TL_Delete(TL1);
TL_Delete(TL2);
HH[0] = c;
LL[0] = c;
for cnt = 1 to 9
{
CC[cnt] = CC[cnt-1][1];
HH[cnt] = LL[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
}
if HH[1] > 0 and LL[1] > 0 then
{
TL1 = TL_New(sdate[1],stime[1],cc[1],sdate,stime,cc[1]);
TL_SetColor(TL1,RED);
TL_SetSize(TL1,2);
TL_SetExtRight(Tl1,true);
}
}
else
{
TL_SetEnd(TL1,sdate,stime,cc[1]);
}
CC[0] = C;
if c > HH[0] Then
HH[0] = c;
if c < LL[0] Then
LL[0] = c;
}
위수식에서 종가가 아닌 전봉 고점저점중간(1/2)에 수평선이 나오게 다시한번수정부탁드립니다,미리감사드립니다,
2020-04-08
1084
글번호 137729
지표