커뮤니티
수식 수정부탁드립니다.
2019-03-12 09:34:59
287
글번호 126962
아래의 조건식에서 진입후 청산시에 동일 시점에 청산과 진입이 동시에 신호가 나올시 청산만 신호가 발생하도록 부탁드립니다.
예를 들어 50.02에 매수 신호에 진입했다가 청산신호가 50.10에 나오고 매수 진입신호가
곧바로 50.10에 동시에 나올시에 매수진입은 되지 않도록 부탁드립니다.
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);
}
답변 1
예스스탁 예스스탁 답변
2019-03-12 15:08:43
안녕하세요
예스스탁입니다.
동일시점에 청산과 진입이 발생하면 스위칭이 되는 내용인데
올려주신 수식이 진입이 봉완성시
무포지션일때 조건만족하면 다음봉 시가에 발생하는 구조로
스위칭이 되지 않는 내용입니다.
해당 진입외에 또다른 진입이 있으시면 해당 진입에 MarketPosition == 0조건 추가해 보시기 바랍니다.
즐거운 하루되세요
> 미완 님이 쓴 글입니다.
> 제목 : 수식 수정부탁드립니다.
>
아래의 조건식에서 진입후 청산시에 동일 시점에 청산과 진입이 동시에 신호가 나올시 청산만 신호가 발생하도록 부탁드립니다.
예를 들어 50.02에 매수 신호에 진입했다가 청산신호가 50.10에 나오고 매수 진입신호가
곧바로 50.10에 동시에 나올시에 매수진입은 되지 않도록 부탁드립니다.
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);
}
다음글
이전글