커뮤니티
추가질문 드립니다.
2011-10-20 14:43:11
383
글번호 43925
매번 친절한 답변 감사합니다.
그리고 진입조건이 여러가지인 경우에 진입하려면
input : ProfitRange(15), LossRange(15);
input : ATRP(20),ATRS(2);
input : 특정일(20111004),특정일시간1(120000),특정일시간2(140000);
input : XO1(1),시작시간1(90000),끝시간1(100000);#XO1이 1이면 사용 0이면 미사용
input : XO2(1),시작시간2(100000),끝시간2(110000);#XO2가 1이면 사용 0이면 미사용
input : XO3(1),시작시간3(110000),끝시간3(120000);#XO3아 1이면 사용 0이면 미사용
#특정일 특정시간안에는 신호발생금지
Condition1 = sdate == 특정일 and stime >= 특정일시간1 and stime <= 특정일시간2;
Condition2 = XO1 == 1 and stime >= 시작시간1 and stime < 끝시간1;
Condition3 = XO2 == 1 and stime >= 시작시간2 and stime < 끝시간2;
Condition4 = XO3 == 1 and stime >= 시작시간3 and stime < 끝시간3;
if Condition1 == false and (Condition2 == true or Condition3 == true or Condition4 == true) Then{
if 진입조건1 then buy();
if 진입조건2 then buy();
if 진입조건3 then buy();
}
SetStopProfitTarget(ProfitRange*PriceScale, PointStop);
SetStopLoss(LossRange*PriceScale, PointStop);
if MarketPosition == 1 Then
exitlong("bx",AtStop,highest(H,BarsSinceEntry)-ATR(ATRP)*ATRS);
이렇게 쓰던지
이렇게 안된다면 반복해서 쓸때 저 부분을 condition5 = ( Condition1 == false and (Condition2 == true or Condition3 == true or Condition4 == true) ) 이렇게 한번에 묶어서 condition5==true 이것만 반복해서 사용할수도 있는건가요?
그리고 예를 들면 매월 첫번째 금요일 몇시부터 몇시까지 이런식으로 매매를 금지시키는것도 필요한데 그것도 부탁드려봅니다.
답변 1
예스스탁 예스스탁 답변
2011-10-20 18:17:46
안녕하세요
예스스탁입니다.
1,
예 말씀하신부분과 같이 사용하실 수 있습니다.
condition5 = ( Condition1 == false and (Condition2 == true or Condition3 == true or Condition4 == true) );
로 묶으시고 condition5 변수를 사용하셔도 됩니다.
2,
Condition6 으로 추가했습니다.
input : ProfitRange(15), LossRange(15);
input : ATRP(20),ATRS(2);
input : 특정일(20111004),특정일시간1(120000),특정일시간2(140000);
input : XO1(1),시작시간1(90000),끝시간1(100000);#XO1이 1이면 사용 0이면 미사용
input : XO2(1),시작시간2(100000),끝시간2(110000);#XO2가 1이면 사용 0이면 미사용
input : XO3(1),시작시간3(110000),끝시간3(120000);#XO3아 1이면 사용 0이면 미사용
input : XO4(1),시작시간4(110000),끝시간4(120000);#XO3아 1이면 사용 0이면 미사용
if date > date[1]+30 Then
var1 = 0;
if sdate != sdate[1] and DayOfWeek(sdate) == 5 Then
var1 = var1;
#특정일 특정시간안에는 신호발생금지
Condition1 = sdate == 특정일 and stime >= 특정일시간1 and stime <= 특정일시간2;
Condition2 = XO1 == 1 and stime >= 시작시간1 and stime < 끝시간1;
Condition3 = XO2 == 1 and stime >= 시작시간2 and stime < 끝시간2;
Condition4 = XO3 == 1 and stime >= 시작시간3 and stime < 끝시간3;
Condition6 = XO4 == 1 and var1 == 1 and stime >= 시작시간4 and stime < 끝시간4;
condition5 = ( Condition1 == false and (Condition2 == true or Condition3 == true or Condition4 == true or Condition6 == true ) );
if Condition5 == true Then{
if 진입조건1 then buy();
if 진입조건2 then buy();
if 진입조건3 then buy();
}
즐거운 하루되세요
> 개냥이 님이 쓴 글입니다.
> 제목 : 추가질문 드립니다.
> 매번 친절한 답변 감사합니다.
그리고 진입조건이 여러가지인 경우에 진입하려면
input : ProfitRange(15), LossRange(15);
input : ATRP(20),ATRS(2);
input : 특정일(20111004),특정일시간1(120000),특정일시간2(140000);
input : XO1(1),시작시간1(90000),끝시간1(100000);#XO1이 1이면 사용 0이면 미사용
input : XO2(1),시작시간2(100000),끝시간2(110000);#XO2가 1이면 사용 0이면 미사용
input : XO3(1),시작시간3(110000),끝시간3(120000);#XO3아 1이면 사용 0이면 미사용
#특정일 특정시간안에는 신호발생금지
Condition1 = sdate == 특정일 and stime >= 특정일시간1 and stime <= 특정일시간2;
Condition2 = XO1 == 1 and stime >= 시작시간1 and stime < 끝시간1;
Condition3 = XO2 == 1 and stime >= 시작시간2 and stime < 끝시간2;
Condition4 = XO3 == 1 and stime >= 시작시간3 and stime < 끝시간3;
if Condition1 == false and (Condition2 == true or Condition3 == true or Condition4 == true) Then{
if 진입조건1 then buy();
if 진입조건2 then buy();
if 진입조건3 then buy();
}
SetStopProfitTarget(ProfitRange*PriceScale, PointStop);
SetStopLoss(LossRange*PriceScale, PointStop);
if MarketPosition == 1 Then
exitlong("bx",AtStop,highest(H,BarsSinceEntry)-ATR(ATRP)*ATRS);
이렇게 쓰던지
이렇게 안된다면 반복해서 쓸때 저 부분을 condition5 = ( Condition1 == false and (Condition2 == true or Condition3 == true or Condition4 == true) ) 이렇게 한번에 묶어서 condition5==true 이것만 반복해서 사용할수도 있는건가요?
그리고 예를 들면 매월 첫번째 금요일 몇시부터 몇시까지 이런식으로 매매를 금지시키는것도 필요한데 그것도 부탁드려봅니다.
다음글
이전글