답변완료
수식부탁드립니다
Input : shortPeriod(5), longPeriod(20);
Var : 단기이평(0), 장기이평(0);
단기이평 = ma(C, shortPeriod);
장기이평 = ma(C, longPeriod);
if crossup(단기이평, 장기이평) then
buy();
if crossdown(단기이평, 장기이평) then
sell();
위와같이 전략을 작성했을경우 따로 청산수식을 하지않아도
매수매도 주문이되는가요??
아니면
단기이평 = ma(C, shortPeriod);
장기이평 = ma(C, longPeriod);
if crossup(단기이평, 장기이평) then
buy();
if crossdown(단기이평, 장기이평) then
sell();
if crossup(단기이평, 장기이평) then
exitshort();
if crossdown(단기이평, 장기이평) then
exitlong();
이렇게 청산전략을 넣어야 하나요??
2021-02-23
607
글번호 146575
시스템
답변완료
수식 가능하면 부탁드립니다.
input : StartTime(91000),EndTime(151000);
Input : shortPeriod(6), longPeriod(410);
input : aaa(-0.75),bbb(0.75);
input : 익절 (5);
var : Tcond(false,Data1);
var : C2(0,Data2);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
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;
C2 = Data2(c);
# 매수/매도청산
If data2(c) >= bbb and (( 현재선물지수 < (Value2-4))or ( 현재선물지수 > (Value2+4)) Then
{
Buy();
}
If data2(c) <= aaa and (( 현재선물지수 < (Value2-4))or ( 현재선물지수 > (Value2+4)) Then
{
Sell();
}
SetStopEndofday(EndTime);
SetStopProfittarget(익절,PointStop);
---------------
위 수식에서
(( 현재선물지수 < (Value2-4))or ( 현재선물지수 > (Value2+4))
이 부분 구현 좀 부탁드립니다.
감사합니다!!!
2021-02-23
654
글번호 146555
시스템
답변완료
수식 가능하면 부탁드립니다.
input : StartTime(130000),EndTime(151000);
var : Tcond(false,Data1);
var : C2(0,Data2);
input : 손절(2.4),익절(3.4);
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;
C2 = Data2(c);
if Tcond == true Then
{
#var : C2(0,Data2);
if crossup(C2,0) then
buy();
if crossdown(C2,0) then
sell();
}
SetStopEndofday(EndTime);
SetStopProfittarget(익절,PointStop);
SetStoploss(손절,PointStop);
---------------
if crossup(C2,0) then
buy();
data2는 엑셀 1분봉입니다.
(crossup(C2,0)) or { (C2 가 연속양봉 4개) and (0 < C2 <0.2) }
이런식으로 가능하다면, 조건식 부탁드립니다.
감사합니다. !!
2021-02-23
610
글번호 146554
시스템