안녕하세요
아래 식을 3분봉에서 적용하려고 합니다.
1. macd 값이 상승으로 전환하면 매수, 하락으로 바뀌면 매도로 스위칭
2. 익절 160틱 손절 80틱
3. 매수 후 스위칭 되지 않고 익절이 되면 최초로 발생하는 3분봉 5이평선 이하에서 재매수
4. 매수 후 손절이 되면 macd라인이 상방이면 바로 다음 3분봉 시초가에 재매수
5. 매도 후 스위칭 되지 않고 익절이 되면 최초로 발생하는 3분봉 5이평선 이상에서 재매도
6. 매도 후 손절이 되면 macd라인이 하방이면 바로 다음 3분봉 시초가에 재매도
7. 거래 개시 09시 거래 종료 익일 05시30분
8. 최초 진입은 수동으로 거래 시작.
아래 식에 어떻게 추가 하면 되는지 문의 드립니다.
input : StartTime(090000),EndTime(053000);
input : 익절틱수(160),손절틱수(80);
input : shortPeriod(12), longPeriod(26);
Var : value(0);
value = MACD(shortPeriod, longPeriod);
if value > value[1] Then
buy();
Else
sell();
감사합니다
답변 1
예스스탁
예스스탁 답변
2023-01-06 14:54:01
안녕하세요
예스스탁입니다.
8. 최초 진입은 수동으로 거래 시작.
위 내용은 수식으로 처리가 가능한 부분이 아닙니다.
수동거래 여부는 식에서 감지하거나 처리가 가능하지 않으므로 유의하시기 바랍니다.
input : StartTime(090000),EndTime(053000);
input : 익절틱수(160),손절틱수(80);
input : shortPeriod(12), longPeriod(26),P(5);
Var : value(0),t(0),mav(0),Tcond(false);
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;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
value = MACD(shortPeriod, longPeriod);
mav = ma(C,P);
if value > value[1] Then
t = 1;
if value < value[1] Then
t = -1;
if Tcond == true Then
{
if MarketPosition <= 0 and t == 1 and t != t[1] Then
buy();
if MarketPosition >= 0 and t == -1 and t != t[1] Then
sell();
if MarketPosition == 0 Then
{
if IsExitName("StopProfitTarget",1) == true Then
{
if MarketPosition(1) == 1 and t == 1 and CrossDown(C,mav) Then
Buy("prb");
if MarketPosition(1) == -1 and t == -1 and CrossUp(C,mav) Then
Sell("prs");
}
if IsExitName("StopLoss",1) == true Then
{
if MarketPosition(1) == 1 and t == 1 Then
buy("lrb",AtMarket);
if MarketPosition(1) == -1 and t == -1 Then
Sell("lrs",AtMarket);
}
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 동백초보 님이 쓴 글입니다.
> 제목 : macd 문의 드립니다.
> 안녕하세요
아래 식을 3분봉에서 적용하려고 합니다.
1. macd 값이 상승으로 전환하면 매수, 하락으로 바뀌면 매도로 스위칭
2. 익절 160틱 손절 80틱
3. 매수 후 스위칭 되지 않고 익절이 되면 최초로 발생하는 3분봉 5이평선 이하에서 재매수
4. 매수 후 손절이 되면 macd라인이 상방이면 바로 다음 3분봉 시초가에 재매수
5. 매도 후 스위칭 되지 않고 익절이 되면 최초로 발생하는 3분봉 5이평선 이상에서 재매도
6. 매도 후 손절이 되면 macd라인이 하방이면 바로 다음 3분봉 시초가에 재매도
7. 거래 개시 09시 거래 종료 익일 05시30분
8. 최초 진입은 수동으로 거래 시작.
아래 식에 어떻게 추가 하면 되는지 문의 드립니다.
input : StartTime(090000),EndTime(053000);
input : 익절틱수(160),손절틱수(80);
input : shortPeriod(12), longPeriod(26);
Var : value(0);
value = MACD(shortPeriod, longPeriod);
if value > value[1] Then
buy();
Else
sell();
감사합니다