커뮤니티
주말 잘 보내셨나요?
2013-06-23 22:47:12
165
글번호 64614
아래와 같은 수식을 사용하고 있습니다
전일 종가대비 오늘 시초가가 얼마 이상 상승하면(외부변수로)
9시부터 몇분까지는 움직임이 심해서 그 시간은 신호 나오는걸 피하고 싶습니다
외부변수로 9시이후 몇시부터 거래하면 좋을지를 시물레이션 해보고 싶습니다
정리해보면 얼마이상 상승시 몇시 몇분 이후로 최초 거래를 하면 좋은지
시물레이션을 하고 싶습니다
참고로 틱 챠트를 쓰고 있습니다
##매수식
input : LossPoint(0.65),양봉갯수(3),음봉갯수(3),재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if MarketPosition <= 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1)) and
MAv1 > MAv2 and
MAv2 > MAv3 and
MAv3 > MAv4 and
C > MAv1 Then{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 Then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,양봉갯수) == 양봉갯수 or Countif(cond1 == true,음봉갯수) == 음봉갯수) and
rebuy < 재매수횟수 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,양봉갯수) == 양봉갯수 or Countif(cond2 == true,음봉갯수) == 음봉갯수 Then
ExitLong("매수청산4");
}
답변 1
예스스탁 예스스탁 답변
2013-06-24 11:34:06
안녕하세요
예스스탁입니다.
외부변수로 gap과 starttime이 추가되었습니다.
지정한 갭이상 발생하고 지정한 시간이후로 신호가 발생됩니다.
##매수식
input : Gap(1),StartTime(93000);
input : LossPoint(0.65),양봉갯수(3),음봉갯수(3),재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if dayopen >= DayClose(1)+Gap and stime >= StartTime and
MarketPosition <= 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1)) and
MAv1 > MAv2 and
MAv2 > MAv3 and
MAv3 > MAv4 and
C > MAv1 Then{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 Then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,양봉갯수) == 양봉갯수 or Countif(cond1 == true,음봉갯수) == 음봉갯수) and
rebuy < 재매수횟수 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,양봉갯수) == 양봉갯수 or Countif(cond2 == true,음봉갯수) == 음봉갯수 Then
ExitLong("매수청산4");
}
즐거운 하루되세요
> 난정욱 님이 쓴 글입니다.
> 제목 : 주말 잘 보내셨나요?
> 아래와 같은 수식을 사용하고 있습니다
전일 종가대비 오늘 시초가가 얼마 이상 상승하면(외부변수로)
9시부터 몇분까지는 움직임이 심해서 그 시간은 신호 나오는걸 피하고 싶습니다
외부변수로 9시이후 몇시부터 거래하면 좋을지를 시물레이션 해보고 싶습니다
정리해보면 얼마이상 상승시 몇시 몇분 이후로 최초 거래를 하면 좋은지
시물레이션을 하고 싶습니다
참고로 틱 챠트를 쓰고 있습니다
##매수식
input : LossPoint(0.65),양봉갯수(3),음봉갯수(3),재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if MarketPosition <= 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1)) and
MAv1 > MAv2 and
MAv2 > MAv3 and
MAv3 > MAv4 and
C > MAv1 Then{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 Then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,양봉갯수) == 양봉갯수 or Countif(cond1 == true,음봉갯수) == 음봉갯수) and
rebuy < 재매수횟수 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,양봉갯수) == 양봉갯수 or Countif(cond2 == true,음봉갯수) == 음봉갯수 Then
ExitLong("매수청산4");
}
이전글