커뮤니티
시스템 매매시간조정
2014-09-23 12:57:13
161
글번호 78748
항상감사드립니다.
1.아래식에 매매시간을 설정하고싶습니다
*** 매매시간 21:00~익일 04:30***
21:00부터 시간을 설정해보니 이전에 나온신호가 21:00부터 다시 나옵니다
시스템식에서 21:00이후부터 나오는 첫신호를 진입신호로 설정하고 싶습니다
2.위조건식에서 진입신호가 발생한 다음 청산후 50틱이상의 수익이 나면 이후 진입신호는
발생금지(매매신호발생후 +50틱 이하이익발생시는 매매지속)
if var10==1 and var20==1 and var13==1 and c>var48[25] and macdv>macds
and upAroon > DnAroon Then
buy("B1");
if var10 == -1 and var20==-1 and var13==-1 and c<var48[25] and macdv<macds
and upAroon < DnAroon Then
sell("S1") ;
답변 1
예스스탁 예스스탁 답변
2014-09-24 10:09:09
안녕하세요
예스스탁입니다.
현재 작성되어 있는 진입조건이 21시 이전부터 만족해서
21시까지 온 조건일수 있습니다.
아래식과 같이 작성하시면 단순 진입시간만 제어를 하게 되고
1번
input : 시작시간(210000),끝시간(043000);
var : Start(false),entrycnt(0);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
Start = True;
entrycnt = entrycnt+1;
}
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then
Start = false;
if Start == true and BarsSinceExit(1) == 1 Then{
if MarketPosition(1) == 1 and ExitPrice(1) >= EntryPrice(1)+PriceScale*50 Then
Start == false;
if MarketPosition(1) == 1 and ExitPrice(1) <= EntryPrice(1)-PriceScale*50 Then
Start == false;
}
if Start == true and
var10==1 and var20==1 and var13==1 and c>var48[25] and macdv>macds
and upAroon > DnAroon Then{
if !(MarketPosition == -1 and C <= EntryPrice-PriceScale*50) Then
buy("B1");
if MarketPosition == -1 and C <= EntryPrice-PriceScale*50 Then
ExitShort("sx");
}
if Start == true and
var10 == -1 and var20==-1 and var13==-1 and c<var48[25] and macdv<macds
and upAroon < DnAroon Then {
if !(MarketPosition == 1 and C <= EntryPrice+PriceScale*50) Then
sell("S1");
if MarketPosition == 1 and C >= EntryPrice+PriceScale*50 Then
ExitLong("bx");
}
아래와 같이 작성하시면
21시 이전부터 유지되온 진입조건은 무시하고
21시 이후에 처음 만족할때부터 진입이 들어가게 됩니다.
input : 시작시간(210000),끝시간(043000);
var : Start(false),entrycnt(0),Bcond(false),Scond(false);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
Start = True;
entrycnt = entrycnt+1;
}
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then
Start = false;
if Start == true and BarsSinceExit(1) == 1 Then{
if MarketPosition(1) == 1 and ExitPrice(1) >= EntryPrice(1)+PriceScale*50 Then
Start == false;
if MarketPosition(1) == 1 and ExitPrice(1) <= EntryPrice(1)-PriceScale*50 Then
Start == false;
}
Bcond = var10==1 and var20==1 and var13==1 and c>var48[25] and macdv>macds and upAroon > DnAroon;
Scond = var10 == -1 and var20==-1 and var13==-1 and c<var48[25] and macdv<macds and upAroon < DnAroon ;
if Start == true and
Bcond == true and Bcond[1] == False Then{
if !(MarketPosition == -1 and C <= EntryPrice-PriceScale*50) Then
buy("B1");
if MarketPosition == -1 and C <= EntryPrice-PriceScale*50 Then
ExitShort("sx");
}
if Start == true and
Scond == true and Scond[1] == False Then {
if !(MarketPosition == 1 and C <= EntryPrice+PriceScale*50) Then
sell("S1");
if MarketPosition == 1 and C >= EntryPrice+PriceScale*50 Then
ExitLong("bx");
}
즐거운 하루되세요
> 조민철 님이 쓴 글입니다.
> 제목 : 시스템 매매시간조정
> 항상감사드립니다.
1.아래식에 매매시간을 설정하고싶습니다
*** 매매시간 21:00~익일 04:30***
21:00부터 시간을 설정해보니 이전에 나온신호가 21:00부터 다시 나옵니다
시스템식에서 21:00이후부터 나오는 첫신호를 진입신호로 설정하고 싶습니다
2.위조건식에서 진입신호가 발생한 다음 청산후 50틱이상의 수익이 나면 이후 진입신호는
발생금지(매매신호발생후 +50틱 이하이익발생시는 매매지속)
if var10==1 and var20==1 and var13==1 and c>var48[25] and macdv>macds
and upAroon > DnAroon Then
buy("B1");
if var10 == -1 and var20==-1 and var13==-1 and c<var48[25] and macdv<macds
and upAroon < DnAroon Then
sell("S1") ;