답변완료
식수정
input : P1(5),P2(20);
Input : short(12), long(26), signal(9);
input : BBP(20),dv(2);
input : StartTime(80000),EndTime(30000);
var : mav1(0),mav2(0),bbup(0),bbdn(0);
Var : MACDv(0), MACDs(0),macdo(0),T(0);
var : Tcond(false);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
MACDv = MACD(short, long);
MACDs = ema(MACDv,signal);
macdo = MACDv-MACDs;
bbup = BollBandUp(BBP,dv);
bbdn = BollBandDown(BBP,dv);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
T = 0;
var1 = 0;
Var2 = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if Tcond == true Then
{
var1 = var1+v;
Var2 = Var2+1;
Var3 = var1/Var2;
if C < DayOpen and mav1 < mav1[1] Then
T = 1;
if T == 1 and
MACDO > 0 and
mav2 > mav2[1] Then
{
if (CrossUp(c,DayOpen) and C < BBup) or
(C > DayOpen and C > bbup and CrossDown(C,mav1)) Then
Buy();
}
if C > DayOpen and mav1 > mav1[1] Then
T = -1;
if T == -1 and
MACDO < 0 and
mav2 < mav2[1] Then
{
if (CrossDown(c,DayOpen) and C > BBdn) or
(C < DayOpen and C < bbdn and CrossUp(C,mav1)) Then
Sell();
}
if MarketPosition == 1 Then
{
# if CrossDown(C,DayOpen) Then
# ExitLong();
# if v >= Var3[1]*5 then
# ExitLong();
}
if MarketPosition == -1 Then
{
# if CrossUp(C,DayOpen) Then
# ExitShort();
# if v >= Var3[1]*5 then
# ExitShort();
}
}
SetStopProfittarget(3.0,PercentStop);
SetStopLoss(1.8,PercentStop);
안녕하세요
위 식에서
식추가 부탁드립니다.
익절.손절기능 삭제(SetStopProfittarget(3.0,PercentStop);
SetStopLoss(1.8,PercentStop);)
추가 매수 당일 시가선위에서 매수 진입후
시가선 아래로 하향시 손절후 바로 매도 전환.
매도 당일 시가선아래서 매도 진입후
당일 시가선위로 상승시 손절후 바로 매수 진입전환.
2022-12-03
1485
글번호 164323
시스템
답변완료
부탁 드립니다
도움에 감사 드립니다.
for .....to 를 사용 하여 간락히 부탁 드립니다.
input : P(10);
var : count(0),cnt(0);
var1 = ma(c,P);
Var99=
iff(var1[1]>var1,1,0)+
iff(var1[2]>var1,1,0)+
iff(var1[3]>var1,1,0)+
iff(var1[4]>var1,1,0)+
iff(var1[5]>var1,1,0)+
iff(var1[6]>var1,1,0)+
iff(var1[7]>var1,1,0)+
iff(var1[8]>var1,1,0)+
iff(var1[9]>var1,1,0)+
iff(var1[10]>var1,1,0)+
'+
'+
'+
iff(var1[P]>var1,1,0);
2022-12-03
853
글번호 164321
지표
답변완료
시스템식부탁드립니다
아래의 지표수식을 활용하여
지표[1]
( 타주기(15분) a < b or 타주기(5분) a < b ) and 현주기 a < b 이면 매수
( 타주기(15분) a > b or 타주기(5분) a > b ) and 현주기 a > b 이면 매도
#####
지표[2]
( 타주기(15분) dir == 1 or 타주기(5분) dor == 1 ) and 현주기 ▲ 이면 매수
( 타주기(15분) dir == -1 or 타주기(5분) dir == -1 ) and 현주기 ▼ 이면 매도
//수식도움부탁드립니다.
/////////지표[1]
input : lengthh(22),k(true),gain(0.7);
var : Price(0),hma(0),hma3(0),a(0),b(0),clr(0);
var : kf1(0),dk1(0),smooth1(0),velo1(0),x1(0),g1(0);
var : kf2(0),dk2(0),smooth2(0),velo2(0),x2(0),g2(0);
price = (h+l)/2;
hma = wma((2 * wma(price, lengthh / 2)) - wma(price, lengthh), round(sqrt(lengthh),0));
hma3= wma(wma(c, (lengthh/2)/3)*3 - wma(c, (lengthh/2)/2) - wma(c, (lengthh/2)), (lengthh/2));
x1 = hma;
g1 = gain;
kf1 = 0.0;
dk1 = x1 - iff(isnan(kf1[1]) == False,kf1[1], x1);
smooth1 = iff(isnan(kf1[1]) == False,kf1[1], x1)+dk1*sqrt(g1*2);
velo1 = 0.0;
velo1 = iff(isnan(velo1[1]) == False,velo1,0) + (g1*dk1);
kf1 = smooth1+velo1;
x2 = hma3;
g2 = gain;
kf2 = 0.0;
dk2 = x2 - iff(isnan(kf2[1]) == False,kf2[1], x2);
smooth2 = iff(isnan(kf2[1]) == False,kf2[1], x2)+dk2*sqrt(g2*2);
velo2 = 0.0;
velo2 = iff(isnan(velo2[1]) == False,velo2,0) + (g2*dk2);
kf2 = smooth2+velo2;
a = iff(k == true, kf1 , hma);
b = iff(k == true, kf2 , hma3);
clr = iff(b > a , red , lime);
Plot1(kf1,"a",clr);
Plot2(kf2,"b",clr);
//////////
////////지표[2]
input : length(2),mult(2),useClose(true),크기(25);
var : ATrv(0),longStop(0),longStopprev(0),shortStop(0),shortStopPrev(0);
var : dir(1),longcolor(plum),shortcolor(lightblue),tx(0);
atrv = mult * atr(length);
longStop = IFf(useClose , highest(close, length) , highest(h,length)) - atrv;
longStopPrev = longStop[1];
longStop = iff(close[1] > longStopPrev , max(longStop, longStopPrev) , longStop);
shortStop = IFf(useClose , lowest(close, length) , lowest(L,length)) + atrv;
shortStopPrev = shortStop[1];
shortStop = iff(close[1] < shortStopPrev , min(shortStop, shortStopPrev) , shortStop);
dir = iff(close > shortStopPrev , 1 ,iff( close < longStopPrev , -1 , dir));
IF dir == 1 Then
{
plot1(longStop,"Long Stop",longColor);
NoPlot(2);
}
Else
{
NoPlot(1);
plot2(shortStop,"Short Stop",shortColor);
}
if dir == 1 and dir[1] == -1 Then
{
tx = Text_New(sDate,sTime,longStop,"▲");
Text_SetStyle(tx,2,0);
Text_SetSize(tx, 크기);
Text_SetColor(tx,longcolor);
}
if dir == -1 and dir[1] == 1 Then
{
tx = Text_New(sDate,sTime,shortStop,"▼");
Text_SetStyle(tx,2,1);
Text_SetSize(tx, 크기);
Text_SetColor(tx,shortcolor);
}
//////////////
수고하세요
2022-12-04
1099
글번호 164318
시스템