커뮤니티
함수 에러 수정 부탁드립니다.
2018-04-09 18:39:49
131
글번호 118059
안녕하세요.
함수 에러 수정 부탁드립니다.
Input : dCNT(2);
Vars : dTT(0);
Vars : SP(0);
Vars : oDayHigh(0), oDayLow(0), H_Time(0), H_date(0), L_time(0), L_date(0);
Vars : blCOND(False);
If IsExitName("ProfitTarget", 1) And ExitDate(1) == Date Then blCOND = True
Else blCOND = False;
If Date[1] <> Date Then dTT = 0;
SP = MarketPosition;
If SP[1] <> SP Then dTT = dTT + 1;
oDayHigh = dayhigh(0);
oDayLow = daylow(0);
// 당일 고가와 현재 고가가 동일할 때의 시간 저장
// 즉, 당일 고가 갱신할 때, 시간 저장
If H == oDayHigh then begin
H_time = time;
H_date = date;
end;
If L == oDayLow then begin
L_time = time;
L_date = date;
end;
If dTT < dCNT Then
Begin
If blCOND Then
Begin
If MarketPosition(1) <> 1 And H_date == date and time >= H_time and H > odayhigh[1] then ;
If MarketPosition(1) <> -1 And L_date == date and time >= L_time and L < odaylow[1] then sell("NSELL");
End
Else
Begin
// 당일 고점이 발생한 시간보다 60분후 이상 경과 했다면
// 고점 갱신 할 때 매수
If H_date == date and time >= H_time and H > odayhigh[1] then buy("BUY");
// 당일 저점이 발생한 시간보다 60분후 이상 경과 했다면
// 저점 갱신 할 때 매도
If L_date == date and time >= L_time and L < odaylow[1] then sell("SELL");
End;
End;
감사합니다.
답변 1
예스스탁 예스스탁 답변
2018-04-10 11:32:39
안녕하세요
예스스탁입니다.
Input : dCNT(2);
Vars : dTT(0);
Vars : SP(0);
Vars : oDayHigh(0), oDayLow(0), H_Time(0), H_date(0), L_time(0), L_date(0);
Vars : blCOND(False);
If IsExitName("StopProfitTarget", 1) And ExitDate(1) == Date Then
blCOND = True;
Else
blCOND = False;
If Date[1] <> Date Then
dTT = 0;
SP = MarketPosition;
If SP[1] <> SP Then
dTT = dTT + 1;
oDayHigh = dayhigh(0);
oDayLow = daylow(0);
// 당일 고가와 현재 고가가 동일할 때의 시간 저장
// 즉, 당일 고가 갱신할 때, 시간 저장
If H == oDayHigh then
begin
H_time = time;
H_date = date;
end;
If L == oDayLow then
begin
L_time = time;
L_date = date;
end;
If dTT < dCNT Then
Begin
If blCOND Then
Begin
If MarketPosition(1) <> 1 And H_date == date and time >= H_time and H > odayhigh[1] then ;
If MarketPosition(1) <> -1 And L_date == date and time >= L_time and L < odaylow[1] then sell("NSELL");
End
Else
Begin
// 당일 고점이 발생한 시간보다 60분후 이상 경과 했다면
// 고점 갱신 할 때 매수
If H_date == date and time >= H_time and H > odayhigh[1] then buy("BUY");
// 당일 저점이 발생한 시간보다 60분후 이상 경과 했다면
// 저점 갱신 할 때 매도
If L_date == date and time >= L_time and L < odaylow[1] then sell("SELL");
End;
End;
즐거운 하루되세요
> 바둑이 님이 쓴 글입니다.
> 제목 : 함수 에러 수정 부탁드립니다.
> 안녕하세요.
함수 에러 수정 부탁드립니다.
Input : dCNT(2);
Vars : dTT(0);
Vars : SP(0);
Vars : oDayHigh(0), oDayLow(0), H_Time(0), H_date(0), L_time(0), L_date(0);
Vars : blCOND(False);
If IsExitName("ProfitTarget", 1) And ExitDate(1) == Date Then blCOND = True
Else blCOND = False;
If Date[1] <> Date Then dTT = 0;
SP = MarketPosition;
If SP[1] <> SP Then dTT = dTT + 1;
oDayHigh = dayhigh(0);
oDayLow = daylow(0);
// 당일 고가와 현재 고가가 동일할 때의 시간 저장
// 즉, 당일 고가 갱신할 때, 시간 저장
If H == oDayHigh then begin
H_time = time;
H_date = date;
end;
If L == oDayLow then begin
L_time = time;
L_date = date;
end;
If dTT < dCNT Then
Begin
If blCOND Then
Begin
If MarketPosition(1) <> 1 And H_date == date and time >= H_time and H > odayhigh[1] then ;
If MarketPosition(1) <> -1 And L_date == date and time >= L_time and L < odaylow[1] then sell("NSELL");
End
Else
Begin
// 당일 고점이 발생한 시간보다 60분후 이상 경과 했다면
// 고점 갱신 할 때 매수
If H_date == date and time >= H_time and H > odayhigh[1] then buy("BUY");
// 당일 저점이 발생한 시간보다 60분후 이상 경과 했다면
// 저점 갱신 할 때 매도
If L_date == date and time >= L_time and L < odaylow[1] then sell("SELL");
End;
End;
감사합니다.
다음글
이전글