커뮤니티

청산동시진입

프로필 이미지
용이
2006-04-25 13:41:50
1195
글번호 9869
답변완료
매수후 청산신호전에 매도신호 나오면 청산후 신규매도 매도후 청산신호전에 매수신호 나오면 청산후 신규매수 맞는지 확인좀 부탁드립니다. var : cond1(0); var : cond01(0); var : cond001(0); var : cond0001(0); var : Bpos(0),Spos(0); cond1 = 매수식1; cond0001 = 매수청산식1; cond01 = 매도식1; cond001 = 매도청산식1; if date != date[1] then //매수 buyCond = 0; if bposition != 1 then Begin if Cond1 then { buy("1"); sposition = 0; bposition = 1; buyCond = 1; } if marketposition() == 1 then Begin //매수청산 if buyCond == 1 and Cond0001 then exitlong("01"); if date != date[1] then //매도 sellCond = 0; if sposition != -1 then Begin if Cond01 then { sell("-1"); bposition = 0; sposition = -1; sellCond = 01; } if marketposition() == -1 then Begin //매도청산 if sellCond == 01 and Cond001 then exitshort("-01");
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2006-04-26 08:56:48

안녕하세요 예스스탁입니다.. if 조건1 then buy(); if 조건2 then exitlong(); if 조건3 then sell(); if 조건4 then exitshort(); 위와 같이 작성될 경우 buy와 sell은 조건을 만족하면 반대방향 진입이 있으면 청산을 하고 들어 가게 됩니다. buy(),sell()조건에 marketposition() == 0 이라는 조건만 없다면 매수후 청산신호전에 매도신호 나오면 청산후 신규매도 매도후 청산신호전에 매수신호 나오면 청산후 신규매수 와 같이 신호가가 발생하며 올리신 식 또한 틀리지 않다고 생각되며 bpos Spos는 불필요한 식 같습니다.. 즐거운 하루되세요 > 용이 님이 쓴 글입니다. > 제목 : 청산동시진입 > 매수후 청산신호전에 매도신호 나오면 청산후 신규매도 매도후 청산신호전에 매수신호 나오면 청산후 신규매수 맞는지 확인좀 부탁드립니다. var : cond1(0); var : cond01(0); var : cond001(0); var : cond0001(0); var : Bpos(0),Spos(0); cond1 = 매수식1; cond0001 = 매수청산식1; cond01 = 매도식1; cond001 = 매도청산식1; if date != date[1] then //매수 buyCond = 0; if bposition != 1 then Begin if Cond1 then { buy("1"); sposition = 0; bposition = 1; buyCond = 1; } if marketposition() == 1 then Begin //매수청산 if buyCond == 1 and Cond0001 then exitlong("01"); if date != date[1] then //매도 sellCond = 0; if sposition != -1 then Begin if Cond01 then { sell("-1"); bposition = 0; sposition = -1; sellCond = 01; } if marketposition() == -1 then Begin //매도청산 if sellCond == 01 and Cond001 then exitshort("-01");
프로필 이미지

용이

2006-04-26 11:32:36

매수,매수청산,매도,매도청산 조건이 여러개라서 부득이 cond를 달아서 각 조건에 따른 매매하게끔 한건데요.예를들어 청산3은 해당 조건맞으면 무조건 실행하는게 아니라 매수3조건상황에서만 청산을 해야겠다..뭐 그런식이죠.때문에 cond방법을쓴겁니다. "buy(),sell()조건에 marketposition() == 0 이라는 조건만 없다면"이게 무슨말인지 잘 모르겠네요. 어디를 손질해야할지도 잘 모르겠고요.죄송하지만 아래식가지고 불필요한걸 없애고 최대한 간결이 식을 정리해주시면 감사하겠습니다.그리고 한가지더..사실상 청산조건과 매도조건이 거의 비슷하기 때문에 청산조건을 그냥 없앨까 싶기도 한데 그 경우 앞서말한데로 매수3 조건에서만 매도3이 나가게끔 하는 건 어찌하면 되나요? > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 청산동시진입 > 안녕하세요 예스스탁입니다.. if 조건1 then buy(); if 조건2 then exitlong(); if 조건3 then sell(); if 조건4 then exitshort(); 위와 같이 작성될 경우 buy와 sell은 조건을 만족하면 반대방향 진입이 있으면 청산을 하고 들어 가게 됩니다. buy(),sell()조건에 marketposition() == 0 이라는 조건만 없다면 매수후 청산신호전에 매도신호 나오면 청산후 신규매도 매도후 청산신호전에 매수신호 나오면 청산후 신규매수 와 같이 신호가가 발생하며 올리신 식 또한 틀리지 않다고 생각되며 bpos Spos는 불필요한 식 같습니다.. 즐거운 하루되세요 > 용이 님이 쓴 글입니다. > 제목 : 청산동시진입 > 매수후 청산신호전에 매도신호 나오면 청산후 신규매도 매도후 청산신호전에 매수신호 나오면 청산후 신규매수 맞는지 확인좀 부탁드립니다. var : cond1(0); var : cond01(0); var : cond001(0); var : cond0001(0); var : Bpos(0),Spos(0); cond1 = 매수식1; cond0001 = 매수청산식1; cond01 = 매도식1; cond001 = 매도청산식1; if date != date[1] then //매수 buyCond = 0; if bposition != 1 then Begin if Cond1 then { buy("1"); sposition = 0; bposition = 1; buyCond = 1; } if marketposition() == 1 then Begin //매수청산 if buyCond == 1 and Cond0001 then exitlong("01"); if date != date[1] then //매도 sellCond = 0; if sposition != -1 then Begin if Cond01 then { sell("-1"); bposition = 0; sposition = -1; sellCond = 01; } if marketposition() == -1 then Begin //매도청산 if sellCond == 01 and Cond001 then exitshort("-01");