커뮤니티
수식문의
2011-05-20 08:37:03
649
글번호 38853
수고하십니다.
맨 아래 기존수식에 다음과 같은 내용을 추가해 줄것을 부탁 드립니다.
9시~11시까지 1회 매매
11시~13시까지 1회 매매
13시~15시까지 1회 매매
이렇게 하루를 3등분해서 각각 한번씩만 신규진입 할수 있게요.
물론 청산 안되고 포지션이 있다면 다음 시간을 넘어 갈수도 있겠죠.
결국 진입은 하루 최대 3번이하가 되겠습니다.
기존수식:
Input : shortPeriod(12), longPeriod(26), Period(9);
value1 = MACD(shortPeriod, longPeriod);
value2 = ema(value1, Period);
If 조건1 Then
Buy();
If 조건2 Then
Sell();
if 청산조건1 Then
exitlong("bx",AtStop,highest(h,BarsSinceEntry)-Tr);
if 청산조건2 Then
ExitShort("sx",AtStop,Lowest(L,BarsSinceEntry)+Tr);
감사합니다
답변 1
예스스탁 예스스탁 답변
2011-05-20 10:41:42
안녕하세요
예스스탁입니다.
Input : shortPeriod(12), longPeriod(26), Period(9);
if date != date[1] Then{
Condition1 = false;
Condition2 = false;
Condition3 = false;
}
if EntryTime >= 90000 and EntryTime < 110000 Then
Condition1 = true;
if EntryTime >= 110000 and EntryTime < 130000 Then
Condition2 = true;
if EntryTime >= 130000 and EntryTime < 150000 Then
Condition3 = true;
value1 = MACD(shortPeriod, longPeriod);
value2 = ema(value1, Period);
if (stime >= 90000 and stime < 110000 and Condition1 == false) Or
(stime >= 110000 and stime < 130000 and Condition2 == false) or
(stime >= 130000 and stime < 150000 and Condition3 == false) then{
If 조건1 Then
Buy();
If 조건2 Then
Sell();
}
if 청산조건1 Then
exitlong("bx",AtStop,highest(h,BarsSinceEntry)-Tr);
if 청산조건2 Then
ExitShort("sx",AtStop,Lowest(L,BarsSinceEntry)+Tr);
즐거운 하루되세요
> 저은아빠 님이 쓴 글입니다.
> 제목 : 수식문의
> 수고하십니다.
맨 아래 기존수식에 다음과 같은 내용을 추가해 줄것을 부탁 드립니다.
9시~11시까지 1회 매매
11시~13시까지 1회 매매
13시~15시까지 1회 매매
이렇게 하루를 3등분해서 각각 한번씩만 신규진입 할수 있게요.
물론 청산 안되고 포지션이 있다면 다음 시간을 넘어 갈수도 있겠죠.
결국 진입은 하루 최대 3번이하가 되겠습니다.
기존수식:
Input : shortPeriod(12), longPeriod(26), Period(9);
value1 = MACD(shortPeriod, longPeriod);
value2 = ema(value1, Period);
If 조건1 Then
Buy();
If 조건2 Then
Sell();
if 청산조건1 Then
exitlong("bx",AtStop,highest(h,BarsSinceEntry)-Tr);
if 청산조건2 Then
ExitShort("sx",AtStop,Lowest(L,BarsSinceEntry)+Tr);
감사합니다
다음글
이전글