아래 수식 부탁 드립니다.
12분봉 기준 macd>0 일 경우 매수진입 후 3분봉 기준 20이평선 하회 시 청산 (3분봉 기준 20이평선 다시 복귀시 재매수 후 훼손시 청산의 프로세스를 12분봉 기준 macd>0인 상태에서 반복)
12분봉 기준 macd<0일 경우 매도진입 후 3분봉 기준 20이평선 상회 시 청산 (3분봉 기준 20이평선 다시 복귀시 재매도 후 훼손시 청산의 프로세스를 12분봉 기준 macd<0인 상태에서 반복)
답변 1
예스스탁
예스스탁 답변
2023-06-30 13:29:02
안녕하세요
예스스탁입니다.
input : 분1(12),P(20);
input : short(12),long(26);
var : S1(0),D1(0),TM(0),EP1(0),EP2(0);
var : TF1(0),i1(0),xma11(0),xma12(0),Prexma11(0),Prexma12(0),MACDV1(0);
var : mav(0);
mav = ma(C,P);
Ep1 = 2/(short+1);
Ep2 = 2/(long+1);
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;
TF1 = TM%분1;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 분1 > 1 and TF1 < TF1[1]) or
(Bdate == Bdate[1] and 분1 > 1 and TM >= TM[1]+분1) or
(Bdate == Bdate[1] and 분1 == 1 and TM > TM[1]) Then
{
i1 = i1 + 1;
Prexma11 = xma11[1];
Prexma12 = xma12[1];
}
if i1 <= 1 then
{
xma11 = C;
xma12 = C;
MACDV1 = xma11-xma12;
}
else
{
xma11 = C * EP1 + Prexma11 * (1-EP1);
xma12 = C * EP2 + Prexma12 * (1-EP2);
MACDV1 = xma11-xma12;
}
if macdv1 > 0 Then
{
if CrossUp(C,mav) Then
Buy();
if CrossDown(c,mav) Then
ExitLong();
}
if macdv1 < 0 Then
{
if CrossDown(C,mav) Then
Sell();
if CrossUp(c,mav) Then
ExitShort();
}
}
즐거운 하루되세요
> zephie 님이 쓴 글입니다.
> 제목 : 수식문의드립니다.
> 아래 수식 부탁 드립니다.
12분봉 기준 macd>0 일 경우 매수진입 후 3분봉 기준 20이평선 하회 시 청산 (3분봉 기준 20이평선 다시 복귀시 재매수 후 훼손시 청산의 프로세스를 12분봉 기준 macd>0인 상태에서 반복)
12분봉 기준 macd<0일 경우 매도진입 후 3분봉 기준 20이평선 상회 시 청산 (3분봉 기준 20이평선 다시 복귀시 재매도 후 훼손시 청산의 프로세스를 12분봉 기준 macd<0인 상태에서 반복)