항상 감사합니다. 아직 배우는 초보자라
각문장의 주석 부탁드립니다.
if (sdate != sdate[1] and stime >= EndTime4) or
(sdate == sdate[1] and stime >= EndTime4 and stime[1] < EndTime4) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if (sdate != sdate[1] and stime >= StartTime4) or
(sdate == sdate[1] and stime >= StartTime4 and stime[1] < StartTime4) Then
{
Tcond = true;
OO = O;
HH = H;
LL = L;
}
if Tcond == true Then
{
if Index == 0 or TotalTrades > TotalTrades[1] Then
{
OO = O;
HH = H;
LL = L;
}
if HH > 0 and H > HH Then
HH = H;
if LL > 0 and L < LL Then
if MarketPosition == 0 and OO > 0 and LL > OO-PriceScale*진입틱수 Then
Sell("s",AtLimit,LL+PriceScale*n);
if MarketPosition == 0 and OO > 0 and HH < OO+PriceScale*진입틱수 Then
Buy("b",AtLimit,HH-PriceScale*n);
답변 1
예스스탁
예스스탁 답변
2021-11-01 10:43:40
안녕하세요
예스스탁입니다.
#전봉과 현재봉 날짜가 다르고 현재봉시간이 EndTime4 이상이거나
#전봉과 현재봉 날짜가 같으면 전봉의 시간은 EndTime4보다 작고 현재봉시간이 EndTime4이상인 경우에는
#즉 당일 중 EndTime4시간 이후의 첫봉이 발생하는 것을 찾는 문장
if (sdate != sdate[1] and stime >= EndTime4) or
(sdate == sdate[1] and stime >= EndTime4 and stime[1] < EndTime4) Then
{
#Tcond는 False
Tcond = False;
#매수포지션 상태이면 청산
if MarketPosition == 1 Then
ExitLong();
#매도포지션 상태이면 청산
if MarketPosition == -1 Then
ExitShort();
}
#전봉과 현재봉 날짜가 다르고 현재봉시간이 StartTime4 이상이거나
#전봉과 현재봉 날짜가 같으면 전봉의 시간은 StartTime4보다 작고 현재봉시간이 StartTime4이상인 경우
#즉 당일 중 StartTime4시간 이후의 첫봉이 발생하는 것을 찾는 문장
if (sdate != sdate[1] and stime >= StartTime4) or
(sdate == sdate[1] and stime >= StartTime4 and stime[1] < StartTime4) Then
{
#Tcond는 true
Tcond = true;
#해당봉의 시고저로 초기값 지정
OO = O;
HH = H;
LL = L;
}
#Tcond가 true(StartTime4~EndTime4)
if Tcond == true Then
{
#청산발생
if Index == 0 or TotalTrades > TotalTrades[1] Then
{
#해당봉의 시고저로 초기값 지정
OO = O;
HH = H;
LL = L;
}
#StartTime4 이후 최고과/최저가 계산
#청산이 발생하면 청산이후 최고가/최저가 계산
#현재봉고가가 HH에 저장된 값보다 크면 HH를 현재봉 고가로 변경
if HH > 0 and H > HH Then
HH = H;
#현재봉저가가 LL에 저장된 값보다 작으면면 LL를 현재봉 저가로 변경
if LL > 0 and L < LL Then
LL = L;
#최저가가 시가대비-진입틱수 이하로 내려간지 않고
#최저가 대비 n틱이상 상승하면 매도진입
if MarketPosition == 0 and OO > 0 and LL > OO-PriceScale*진입틱수 Then
Sell("s",AtLimit,LL+PriceScale*n);
#최고가가 시가대비+진입틱수 이상으로 오라가지 않고
#최고가 대비 n틱이상 하락하면 매수진입
if MarketPosition == 0 and OO > 0 and HH < OO+PriceScale*진입틱수 Then
Buy("b",AtLimit,HH-PriceScale*n);
}
즐거운 하루되세요
> 예스요 님이 쓴 글입니다.
> 제목 : 주석 부탁드립니다~~~~
> 항상 감사합니다. 아직 배우는 초보자라
각문장의 주석 부탁드립니다.
if (sdate != sdate[1] and stime >= EndTime4) or
(sdate == sdate[1] and stime >= EndTime4 and stime[1] < EndTime4) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if (sdate != sdate[1] and stime >= StartTime4) or
(sdate == sdate[1] and stime >= StartTime4 and stime[1] < StartTime4) Then
{
Tcond = true;
OO = O;
HH = H;
LL = L;
}
if Tcond == true Then
{
if Index == 0 or TotalTrades > TotalTrades[1] Then
{
OO = O;
HH = H;
LL = L;
}
if HH > 0 and H > HH Then
HH = H;
if LL > 0 and L < LL Then
if MarketPosition == 0 and OO > 0 and LL > OO-PriceScale*진입틱수 Then
Sell("s",AtLimit,LL+PriceScale*n);
if MarketPosition == 0 and OO > 0 and HH < OO+PriceScale*진입틱수 Then
Buy("b",AtLimit,HH-PriceScale*n);