커뮤니티
문의드립니다
2011-10-10 15:49:17
422
글번호 43523
밑에서 이렇게 답변을 주셨는데..
제가 원하는 것은
1번이 조건을 만족하여 실행되면 2번은 하루종일 실행이 되지 말아야 하며,
2번이 조건을 만족하여 실행되면 1번은 하루종일 실행이 되지 말아야 합니다.
(9시13분에서 매매전략이 달라짐)
예스랭귀지로 불가능한가요?
1.
var : Count(0),cnt(0);
count = 0;
for cnt = 0 to 10{
if EntryDate(cnt) == sdate Then
count = count+1;
}
if stime == 91300 Then
var1 = O;
if stime > 91300 and stime < 150000 Then{
if count == 0 Then{
buy("b1",AtStop,var1+PriceScale*10);
}
if count > 0 Then{
if MarketPosition != 1 Then
buy("b",AtStop,var1);
if MarketPosition != -1 Then
sell("s",AtStop,var1-PriceScale*15);
}
}
2.
var : Count(0),cnt(0);
count = 0;
for cnt = 0 to 10{
if EntryDate(cnt) == sdate Then
count = count+1;
}
if stime == 91300 Then
var1 = O;
if stime > 91300 and stime < 150000 Then{
if count == 0 Then{
Sell("s1",AtStop,var1-PriceScale*10);
}
if count > 0 Then{
if MarketPosition != 1 Then
buy("b",AtStop,var1+PriceScale*15);
if MarketPosition != -1 Then
sell("s",AtStop,var1);
}
}
답변 1
예스스탁 예스스탁 답변
2011-10-10 17:10:51
안녕하세요
예스스탁입니다.
수정한 식입니다.
var : Count(0),cnt(0);
count = 0;
for cnt = 0 to 10{
if EntryDate(cnt) == sdate Then
count = count+1;
}
if stime == 91300 Then{
var1 = O;
Condition1 = false;
Condition2 = false;
}
if Condition2 == false and EntryDate == sdate and IsEntryName("BuyStart") == true Then
Condition1 = true;
if Condition1 == false and EntryDate == sdate and IsEntryName("SellStart") == true Then
Condition2 = true;
if stime > 91300 and stime < 150000 Then{
if count == 0 and Condition1 == false and Condition2 == false Then{
buy("BuyStart",AtStop,var1+PriceScale*10);
}
if count > 0 and Condition1 == true Then{
if MarketPosition != 1 Then
buy("b1",AtStop,var1);
if MarketPosition != -1 Then
sell("s1",AtStop,var1-PriceScale*15);
}
}
if stime > 91300 and stime < 150000 Then{
if count == 0 and Condition1 == false and Condition2 == false Then{
Sell("SellStart",AtStop,var1-PriceScale*10);
}
if count > 0 and Condition2 == true Then{
if MarketPosition != 1 Then
buy("b2",AtStop,var1+PriceScale*15);
if MarketPosition != -1 Then
sell("s2",AtStop,var1);
}
}
즐거운 하루되세요
> coolmind 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 밑에서 이렇게 답변을 주셨는데..
제가 원하는 것은
1번이 조건을 만족하여 실행되면 2번은 하루종일 실행이 되지 말아야 하며,
2번이 조건을 만족하여 실행되면 1번은 하루종일 실행이 되지 말아야 합니다.
(9시13분에서 매매전략이 달라짐)
예스랭귀지로 불가능한가요?
1.
var : Count(0),cnt(0);
count = 0;
for cnt = 0 to 10{
if EntryDate(cnt) == sdate Then
count = count+1;
}
if stime == 91300 Then
var1 = O;
if stime > 91300 and stime < 150000 Then{
if count == 0 Then{
buy("b1",AtStop,var1+PriceScale*10);
}
if count > 0 Then{
if MarketPosition != 1 Then
buy("b",AtStop,var1);
if MarketPosition != -1 Then
sell("s",AtStop,var1-PriceScale*15);
}
}
2.
var : Count(0),cnt(0);
count = 0;
for cnt = 0 to 10{
if EntryDate(cnt) == sdate Then
count = count+1;
}
if stime == 91300 Then
var1 = O;
if stime > 91300 and stime < 150000 Then{
if count == 0 Then{
Sell("s1",AtStop,var1-PriceScale*10);
}
if count > 0 Then{
if MarketPosition != 1 Then
buy("b",AtStop,var1+PriceScale*15);
if MarketPosition != -1 Then
sell("s",AtStop,var1);
}
}
다음글
이전글