커뮤니티
조건식 수정 부탁드립니다.
2018-04-16 18:52:04
148
글번호 118258
if T == 1 and CrossUP(value1, value2) then
buy("매수1",AtMarket);
if MarketPosition == 1 Then
{
if T == -1 and 추세[0] == "매도추세" Then
Exitlong("추세전환(-)",AtMarket);
if T == 1 and 추세[0] == "매도추세" Then
Exitlong("bx1",Atlimit,EntryPrice+PriceScale*50);
if T == -1 and 추세[0] == "매수추세" Then
Exitlong"bx2",Atlimit,EntryPrice+PriceScale*50);
}
if T == -1 and CrossDown(value1, value2) then
sell("매도1",AtMarket);
if MarketPosition == -1 Then
{
if T == 1 and 추세[0] == "매수추세" Then
ExitShort("추세전환(+)",AtMarket);
if T == -1 and 추세[0] == "매수추세" Then
ExitShort("sx1",Atlimit,EntryPrice-PriceScale*50);
if T == 1 and 추세[0] == "매도추세" Then
ExitShort("sx2",Atlimit,EntryPrice-PriceScale*50);
위 시스템 서식에서 먼저 진입신호(매수나 매도)에 의해 매매가 진행중일때 조건식(3가지)에 의해 청산되기전 반대 진입신호(매도나 매수)가 나올시 그 신호를 무시하고 청산 시스템 서식에 의해 청산이 되도록 변경 부탁드립니다.
예를 들어 T = 1(매수신호)에 의해 진입했을시 청산조건 3가지 조건에 부합되지 않았는데
T = -1(매도신호)이고 CrossDown 신호가 나왔을시 매도 진입으로 인식하고 청산, 매도가 동시에 이루어 지는데 이를 방지하고 정상적인 매도청산 조건에서 청산되도록 부탁드립니다.
답변 1
예스스탁 예스스탁 답변
2018-04-17 13:28:26
안녕하세요
예스스탁입니다.
if MarketPosition == 0 and T == 1 and CrossUP(value1, value2) then
buy("매수1",AtMarket);
if MarketPosition == 1 Then
{
if T == -1 and 추세[0] == "매도추세" Then
Exitlong("추세전환(-)",AtMarket);
if T == 1 and 추세[0] == "매도추세" Then
Exitlong("bx1",Atlimit,EntryPrice+PriceScale*50);
if T == -1 and 추세[0] == "매수추세" Then
Exitlong"bx2",Atlimit,EntryPrice+PriceScale*50);
}
if MarketPosition == 0 and T == -1 and CrossDown(value1, value2) then
sell("매도1",AtMarket);
if MarketPosition == -1 Then
{
if T == 1 and 추세[0] == "매수추세" Then
ExitShort("추세전환(+)",AtMarket);
if T == -1 and 추세[0] == "매수추세" Then
ExitShort("sx1",Atlimit,EntryPrice-PriceScale*50);
if T == 1 and 추세[0] == "매도추세" Then
ExitShort("sx2",Atlimit,EntryPrice-PriceScale*50);
}
즐거운 하루되세요
> 미완 님이 쓴 글입니다.
> 제목 : 조건식 수정 부탁드립니다.
> if T == 1 and CrossUP(value1, value2) then
buy("매수1",AtMarket);
if MarketPosition == 1 Then
{
if T == -1 and 추세[0] == "매도추세" Then
Exitlong("추세전환(-)",AtMarket);
if T == 1 and 추세[0] == "매도추세" Then
Exitlong("bx1",Atlimit,EntryPrice+PriceScale*50);
if T == -1 and 추세[0] == "매수추세" Then
Exitlong"bx2",Atlimit,EntryPrice+PriceScale*50);
}
if T == -1 and CrossDown(value1, value2) then
sell("매도1",AtMarket);
if MarketPosition == -1 Then
{
if T == 1 and 추세[0] == "매수추세" Then
ExitShort("추세전환(+)",AtMarket);
if T == -1 and 추세[0] == "매수추세" Then
ExitShort("sx1",Atlimit,EntryPrice-PriceScale*50);
if T == 1 and 추세[0] == "매도추세" Then
ExitShort("sx2",Atlimit,EntryPrice-PriceScale*50);
위 시스템 서식에서 먼저 진입신호(매수나 매도)에 의해 매매가 진행중일때 조건식(3가지)에 의해 청산되기전 반대 진입신호(매도나 매수)가 나올시 그 신호를 무시하고 청산 시스템 서식에 의해 청산이 되도록 변경 부탁드립니다.
예를 들어 T = 1(매수신호)에 의해 진입했을시 청산조건 3가지 조건에 부합되지 않았는데
T = -1(매도신호)이고 CrossDown 신호가 나왔을시 매도 진입으로 인식하고 청산, 매도가 동시에 이루어 지는데 이를 방지하고 정상적인 매도청산 조건에서 청산되도록 부탁드립니다.
다음글
이전글