답변완료
지표 및 시스템 수식전환
아래 키움수식을 예스 지표수식으로 전환 및 시스템 수식으로 전환부탁드립니다.
수식1
if(ma(c,period,이평종류)>=ma(c(1),period,이평종류),ma(c,period,이평종류),0)//상승
수식2
if(ma(c,period,이평종류)<ma(c(1),period,이평종류),ma(c,period,이평종류),0)//하락
지표조건설정
period 20
이평종류 단순
2020-04-16
885
글번호 137977
지표
답변완료
부탁드립니다.
감사합니다.
다시 한번 부탁드립니다.
TR3와 R3의 값이 StopTrailing, StopLoss 된 후 다음 바에 한번씩 만
표시될 수 있도록 부탁드립니다.
마지막 StopTrailing, StopLoss 된 값이 R3값이 반영되도록
StopTrailing, StopLoss 된 후 다음 바에 표시될 수 있도록 부탁드립니다.
input : 시작(40), 종료(50);
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);
## 카운트3
var : tx3(0),cnt3(0),sum3(0),lcnt3(0),trcnt3(0),R3(-1), TR3(0), GR3(0);
Array : XX3[200](-1);
var1 = ma(C, P1);
var2 = ma(C, P2);
var3 = ma(C, P3);
if TotalTrades >= 300 Then
value1 = 0.03;
else if 200 < TotalTrades and TotalTrades < 300 Then
value1 = 0.04;
else
value1 = 0.05;
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 Tcond == true then
{
if marketposition == 0 and crossup(var1,var2) Then {
if Condition3 == true then #### <-- 수정요청
buy("B1■");
Else
buy("B1");
}
if marketposition == 0 and crossdown(var1,var2) Then {
if Condition3 == true then #### <-- 수정요청
sell("S1■");
Else
sell("S1");
}
if marketposition == 0 and crossup(var2,var3) and var3[1] < var3 Then {
if Condition3 == true then #### <-- 수정요청
buy("B2■");
Else
buy("B2");
}
if marketposition == 0 and crossdown(var3,var4) and var3[1] > var3 Then {
if Condition3 == true then #### <-- 수정요청
sell("S2■");
Else
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
{
lcnt3 = lcnt3+1;
XX3[0] = 0;
for cnt3 = 1 to 199
{
XX3[cnt3] = XX3[cnt3-1][1];
}
if Floor((trcnt3+lcnt3)*(value1)) > 1 then
{
sum3 = 0;
for cnt3 = 0 to Floor((trcnt3+lcnt3)*(value1))-1
{
if XX3[cnt3] == 1 Then
sum3 = sum3 + 1;
}
R3 = sum3/Floor((trcnt3+lcnt3)*(value1))*100;
}
}
if IsExitName("StopTrailing",1) == true then
{
trcnt3 = trcnt3+1;
XX3[0] = 1;
for cnt3 = 1 to 199
{
XX3[cnt3] = XX3[cnt3-1][1];
}
if Floor((trcnt3+lcnt3)*(value1)) > 1 then
{
sum3 = 0;
for cnt3 = 0 to Floor((trcnt3+lcnt3)*(value1))-1
{
if XX3[cnt3] == 1 Then
sum3 = sum3+1;
}
R3 = sum3/Floor((trcnt3+lcnt3)*(value1))*100;
}
}
TR3 = trcnt3/(trcnt3+lcnt3)*100 ;
}
if R3 <= 시작 and R3[1] > 시작 Then
Condition3 = true;
if Condition3 == true
and R3 >= 종료 and R3[1] < 종료 Then
Condition3 = false;
Text_Delete(tx3);
tx3 = Text_New(NextBarSdate,NextBarStime,H,NumToStr(TR3,1)+NewLine+NumToStr(R3,1));
Text_SetSize(tx3,15);
Text_Setstyle(tx3,2,20);
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");
}
}
2020-04-16
852
글번호 137974
시스템
답변완료
시스템 수식전환 부탁
input:P1(10),P2(30);
var1=ma(C,P1);
var2=ema(C,P1);
var3=ema(ema(ema(C,P2),P2),P2);
Condition1=CrossUP(var1,var3) or CrossUp(var2,var3);
Condition2=CrossDown(var1,var3) or CrossDown(var2,var3);
if Condition1 ==true Then value1=c;
if value1>0 and C>value1 Then
value1=c;
if Condition2==true Then
value2=c;
if value2>0 and C<value2 Then
value2=c;
if value1>0 and value2>0 Then
value3=(value1+value2)/2;
plot1(value1);
plot2(value2);
plot3(value3);
<1>위 지표에서 PLOT3이 나타날 때(수평선이 그어질 때) 캔들이 PLOT3보다 위에있으면서 동시에 PLOT1에 캔들의 위꼬리나 캔들몸통(음봉)이 닿을 때 매도,
<2>PLOT3이 나타날 때(수평선이 그어질 때) 캔들이 PLOT3보다 아래에 있으면서 동시에 PLOT2에 캔들의 아래꼬리나 캔들몸통(양봉)이 닿을때 매수.
<3>일목균형표에서 전환선이 위 PLOT3처럼 나타날 때(수평선이 그어질 때)
캔들이 전환선보다 위에 있으면서 동시에 위 지표상 PLOT1에 캔들의 위꼬리나 캔들몸통(음봉)이 닿을 때 매도,
<4>일목균형표에서 전환선이 위 PLOT3처럼 나타날 때(수평선이 그어질 때)
캔들이 전환선보다 아래에 있으면서 동시에 위 지표상 PLOT1에 캔들의 아래꼬리나 캔들몸통(양봉)이 닿을 때 매수시스템 수식전환 부탁드립니다.
2020-04-16
764
글번호 137971
시스템
답변완료
문의드립니다.
dpo_length = input(24)
dpo_src = close
dpo_disp = (dpo_src - sma(dpo_src[round(dpo_length/2) + 1], dpo_length))
dpo = (dpo_src - sma(dpo_src, dpo_length))
dpo_f = (dpo / dpo_src) * 100
dpo_df = (dpo_disp / dpo_src) * 100
//dpo_trend = dpo_disp - dpo
//dpo_cycle = dpo_trend + dpo_disp
dpo_trend = dpo_df - dpo_f
dpo_cycle = dpo_trend + dpo_df
dpo_h = highest(dpo_cycle, dpo_length)
dpo_l = lowest(dpo_cycle, dpo_length)
dpo_hlc(s) => s == s[1] ? gray : na
plot(dpo_h, style=line, color=dpo_hlc(dpo_h), linewidth=2)
plot(dpo_l, style=line, color=dpo_hlc(dpo_l), linewidth=2)
dpo_diff = dpo_cycle-dpo_trend
plot(dpo_cycle, color=black, style=line, linewidth=3, transp=50)
plot(dpo_diff, style=histogram, color=gray, linewidth=4)
tc = rising(dpo_trend, 1) ? green : maroon
plot(dpo_trend, color=tc, style=circles, linewidth=3, join=true)
hline(0)
변환 문의드립니다. 감사합니다.
2020-04-16
798
글번호 137959
지표