커뮤니티
지연후 진입
2013-11-06 13:01:32
185
글번호 69251
안녕하세요.
(배경)
데이트레이딩 당일청산인데
##1
진입신호가 A, B ,C, D, E가 있습니다.
다섯개 신호 모두 하루 한번만 실행되도록 했고
각각은 리버스시스템이 아니라 특정신호가 청산되어
포지션이 없을 때만 다른 신호가 발생하도록 했습니다.
(요청)
1. A~E의 원래 신호발생시에는 화면에 "예비매수A"라고 강조표시가 뜨고
2. 매수신호자체는 원래 매수하기로 되어있던 가격으로부터 0.1%하락한 상황에서
"매수A"의 진입신호가 나게 하려면 어떻게 할까요?
## 2.
동일 로직으로 첫번째 매수신호에는 진입하지 않고 두번째 매수신호가 났을 때 진입한다는
식은 어떻게 표현하나요?
감사합니다.
감사합니다.
답변 1
예스스탁 예스스탁 답변
2013-11-06 20:06:56
안녕하세요
예스스탁입니다.
1.
아래식 참고하시기 바랍니다.
var : Acond(false),Bcond(false),Ccond(false),Dcond(false),Econd(false);
var : APrice(0),BPrice(0),CPrice(0),DPrice(0),EPrice(0);
var : cnt(0),Acount(0),Bcount(0),Ccount(0),Dcount(0),Ecount(0);
if date != date[1] Then{
Acond = false;
Bcond = false;
Ccond = false;
Dcond = false;
Econd = false;
}
for cnt = 0 to 10{
if sdate == EntryDate(cnt) and IsEntryName("A",cnt) == true Then
Acount = Acount+1;
if sdate == EntryDate(cnt) and IsEntryName("A",cnt) == true Then
Bcount = Bcount+1;
if sdate == EntryDate(cnt) and IsEntryName("A",cnt) == true Then
Ccount = Ccount+1;
if sdate == EntryDate(cnt) and IsEntryName("A",cnt) == true Then
Dcount = Dcount+1;
if sdate == EntryDate(cnt) and IsEntryName("A",cnt) == true Then
Ecount = Ecount+1;
}
if MarketPosition == 0 and 조건A and Acount < 1 Then{
text_New(sdate,stime,H,"예비매수A");
Acond = true;
APrice = C;
}
if Acond == true and Acount < 1 Then
buy("A",atlimit,Aprice*0.999);
if MarketPosition == 0 and 조건B and Bcount < 1 Then{
text_New(sdate,stime,H,"예비매수B");
Bcond = true;
BPrice = C;
}
if Bcond == true and Bcount < 1 Then
buy("B",atlimit,Bprice*0.999);
if MarketPosition == 0 and 조건C and Ccount < 1 Then{
text_New(sdate,stime,H,"예비매수C");
Ccond = true;
CPrice = C;
}
if Ccond == true and Ccount < 1 Then
buy("C",atlimit,Cprice*0.999);
if MarketPosition == 0 and 조건D and Dcount < 1 Then{
text_New(sdate,stime,H,"예비매수D");
Dcond = true;
DPrice = C;
}
if Dcond == true and Dcount < 1 Then
buy("D",atlimit,Dprice*0.999);
if MarketPosition == 0 and 조건E and Ecount < 1 Then{
text_New(sdate,stime,H,"예비매수E");
Econd = true;
EPrice = C;
}
if Econd == true and Ecount < 1 Then
buy("E",atlimit,Eprice*0.999);
2.
신호를 하나를 건너뛰는 것은 실제 식이 있어야 작성을 해볼수가 있습니다.
진입과 청산까지의 하나의 구간으로 보고 제어를 하는 부분이라
실제 사용되는 식에 맞춰 작성해야 합니다.
아래식 참고하셔서 수정보완해 작성하시기 바랍니다.
var : Acond(false),Bcond(false),Ccond(false),Dcond(false),Econd(false);
var : Entry(0);
if date != date[1] Then{
Entry = 0;
Condition1= false;
}
#첫번째 만족한 조건이 A이면 1저장
if Entry == 0 and 매수A Then
Entry = 1;
#첫번째 만족한 조건이 A이면 2저장
if Entry == 0 and 매수B Then
Entry = 2;
#첫번째 만족한 조건이 A이면 3저장
if Entry == 0 and 매수C Then
Entry = 3;
#첫번째 만족한 조건이 A이면 4저장
if Entry == 0 and 매수D Then
Entry = 4;
#첫번째 만족한 조건이 A이면 5저장
if Entry == 0 and 매수E Then
Entry = 5;
#1이상 저장된후 청산조건이 만족하면 Condition1은 true로 변경
if Entry >= 1 and 청산조건 Then
Condition1 = true;
#Condition1이 true이고 entry가 1이 아니고 매수A조건 만족하면 매수
if Condition1 == true and entry != 1 and 매수A Then
buy("A");
#Condition1이 true이고 entry가 2가 아니고 매수A조건 만족하면 매수
if Condition1 == true and entry != 2 and 매수A Then
buy("B");
#Condition1이 true이고 entry가 3이 아니고 매수A조건 만족하면 매수
if Condition1 == true and entry != 3 and 매수A Then
buy("C");
#Condition1이 true이고 entry가 4가 아니고 매수A조건 만족하면 매수
if Condition1 == true and entry != 4 and 매수A Then
buy("D");
#Condition1이 true이고 entry가 5가 아니고 매수A조건 만족하면 매수
if Condition1 == true and entry != 5 and 매수A Then
buy("E");
즐거운 하루되세요
> 대단한콩 님이 쓴 글입니다.
> 제목 : 지연후 진입
> 안녕하세요.
(배경)
데이트레이딩 당일청산인데
##1
진입신호가 A, B ,C, D, E가 있습니다.
다섯개 신호 모두 하루 한번만 실행되도록 했고
각각은 리버스시스템이 아니라 특정신호가 청산되어
포지션이 없을 때만 다른 신호가 발생하도록 했습니다.
(요청)
1. A~E의 원래 신호발생시에는 화면에 "예비매수A"라고 강조표시가 뜨고
2. 매수신호자체는 원래 매수하기로 되어있던 가격으로부터 0.1%하락한 상황에서
"매수A"의 진입신호가 나게 하려면 어떻게 할까요?
## 2.
동일 로직으로 첫번째 매수신호에는 진입하지 않고 두번째 매수신호가 났을 때 진입한다는
식은 어떻게 표현하나요?
감사합니다.
감사합니다.
다음글
이전글