커뮤니티

문의 합니다.

프로필 이미지
오르8
2016-07-29 05:27:38
127
글번호 100515
답변완료
1.문의 var : BXcond(false),Sxcond(false); BXcond = MarketPosition == 0 and MarketPosition(1) == 1 and ExitDate(1) == sdate and IsExitName("StopProfitTarget",1) == true; SXcond = MarketPosition == 0 and MarketPosition(1) == -1 and ExitDate(1) == sdate and IsExitName("StopProfitTarget",1) == true; if BXcond == false and C > dayopen Then buy(); if SXcond == false and C < dayopen Then sell(); if MarketPosition == 1 Then ExitLong("bx",AtStop,dayopen-PriceScale*5); if MarketPosition == -1 Then ExitShort("sx",AtStop,dayopen+PriceScale*5); 위의 수식에서 추가 수식 부탁합니다.. 1)무포지션진입시(또는 최초진입시에는)제약조건 없이 시가 위에 있으면 매수, 아래 있으면 매도. 진입이후 +,-5틱은 무시(포지션변경금지) 2)13시00분 까지는 익절 10틱, 13시이후에는 강제청산목표수익설정시 강제청산 설정을 따른다. 3)일일종가(06:00분)에는 청산을 한다. 2.문의 var : cnt(0),count(0); for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if (count < 1 or MarketPosition == 0) and crossup(C,dayopen) Then buy(); if MarketPosition == -1 and count >= 1 and crossup(C,dayopen+PriceScale*5) Then buy(); if (count < 1 or MarketPosition == 0) and crossdown(C,dayopen) Then sell(); if MarketPosition == 1 and count >= 1 and crossdown(C,dayopen-PriceScale*5) Then sell(); 위의 수식에서 추가수식 부탁합니다.. 1) 손절을 시가에서 +,- 10틱 2) 13:00분 까지는 익절을 10틱, 13시이후는 강제청산 설정시 설정을 따른다. 3) 일일 종가에는 청산한다. 고맙습니다... 부탁드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-07-29 14:17:50

안녕하세요 예스스탁입니다. 설정창의 폭표수익 강제청산은 시간으로 조절이 되지 않습니다. 수식에 13시이전 목표수익틱수와 이후의 목표수익틱수설정하게 외부변수 처리해 드립니다. 설정창의 강제청산 목표수익을 사용하지 마시고 외부변수로 조절하시기 바랍니다. 1. input : 시가폭틱수(10),손절틱수(5),목표수익틱수1(10),목표수익틱수2(20); var : entry(0); var : BXcond(false),Sxcond(false); if Bdate != Bdate[1] Then entry = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry = entry+1; #당일 첫진입이거나 무포지션에서 직전에 손절로 끝난경우에는 시초가 기준으로만 진입 if entry < 1 or (MarketPosition == 0 and (IsExitName("BL",1) == true or IsExitName("SL",1) == true)) then{ if C > dayopen Then buy("b1"); if C < dayopen Then sell("s1"); } #당일 두번째 진입부터 if entry >= 1 Then{ #매도포지션이거나 무포지션인데 매도수익청산으로 끝난경우 시가+시가폭틱수 이상이면 매수진입 if (MarketPosition == -1 or (MarketPosition == 0 and IsExitName("SP1",1) == true or IsExitName("SP2",1) == true)) and C > dayopen+PriceScale*시가폭틱수 Then buy("b2"); #매수포지션이거나 무포지션인데 매수수익청산으로 끝난경우 시가-시가폭틱수 이하이면 매도진입 if (MarketPosition == -1 or (MarketPosition == 0 and IsExitName("BP1",1) == true or IsExitName("BP2",1) == true)) and C < dayopen-PriceScale*시가폭틱수 Then sell("s2"); } if MarketPosition == 1 Then{ ExitLong("bl",AtStop,dayopen-PriceScale*손절틱수); if stime >= 070000 and stime < 130000 Then ExitLong("BP1",Atlimit,EntryPrice+PriceScale*목표수익틱수1);//13시 이전 목표수익 10틱 Else ExitLong("BP2",Atlimit,EntryPrice+PriceScale*목표수익틱수2);//13시 이후 목표수익 20틱 } if MarketPosition == -1 Then{ ExitShort("sl",AtStop,dayopen+PriceScale*손절틱수); if stime >= 070000 and stime < 130000 Then ExitShort("SP1",Atlimit,EntryPrice-PriceScale*목표수익틱수1);//13시 이전 목표수익 10틱 Else ExitShort("SP2",Atlimit,EntryPrice-PriceScale*목표수익틱수2);//13시 이후 목표수익 20틱 } 2 input : 시가폭틱수(5),손절틱수(10),목표수익틱수1(10),목표수익틱수2(20); var : entry(0); var : BXcond(false),Sxcond(false); if Bdate != Bdate[1] Then entry = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry = entry+1; if (entry < 1 or MarketPosition == 0) and crossup(C,dayopen) Then buy(); if MarketPosition == -1 and entry >= 1 and crossup(C,dayopen+PriceScale*시가폭틱수) Then buy(); if (entry < 1 or MarketPosition == 0) and crossdown(C,dayopen) Then sell(); if MarketPosition == 1 and entry >= 1 and crossdown(C,dayopen-PriceScale*시가폭틱수) Then sell(); if MarketPosition == 1 Then{ ExitLong("bl",AtStop,dayopen-PriceScale*손절틱수); if stime >= 070000 and stime < 130000 Then ExitLong("BP1",Atlimit,EntryPrice+PriceScale*목표수익틱수1);//13시 이전 목표수익 10틱 Else ExitLong("BP2",Atlimit,EntryPrice+PriceScale*목표수익틱수2);//13시 이후 목표수익 20틱 } if MarketPosition == -1 Then{ ExitShort("sl",AtStop,dayopen+PriceScale*손절틱수); if stime >= 070000 and stime < 130000 Then ExitShort("SP1",Atlimit,EntryPrice-PriceScale*목표수익틱수1);//13시 이전 목표수익 10틱 Else ExitShort("SP2",Atlimit,EntryPrice-PriceScale*목표수익틱수2);//13시 이후 목표수익 20틱 } if stime == 55000 or (stime > 55000 and stime[1] < 55000) Then{ ExitLong(); ExitShort(); } 즐거운 하루되세요 > 오르8 님이 쓴 글입니다. > 제목 : 문의 합니다. > 1.문의 var : BXcond(false),Sxcond(false); BXcond = MarketPosition == 0 and MarketPosition(1) == 1 and ExitDate(1) == sdate and IsExitName("StopProfitTarget",1) == true; SXcond = MarketPosition == 0 and MarketPosition(1) == -1 and ExitDate(1) == sdate and IsExitName("StopProfitTarget",1) == true; if BXcond == false and C > dayopen Then buy(); if SXcond == false and C < dayopen Then sell(); if MarketPosition == 1 Then ExitLong("bx",AtStop,dayopen-PriceScale*5); if MarketPosition == -1 Then ExitShort("sx",AtStop,dayopen+PriceScale*5); 위의 수식에서 추가 수식 부탁합니다.. 1)무포지션진입시(또는 최초진입시에는)제약조건 없이 시가 위에 있으면 매수, 아래 있으면 매도. 진입이후 +,-5틱은 무시(포지션변경금지) 2)13시00분 까지는 익절 10틱, 13시이후에는 강제청산목표수익설정시 강제청산 설정을 따른다. 3)일일종가(06:00분)에는 청산을 한다. 2.문의 var : cnt(0),count(0); for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if (count < 1 or MarketPosition == 0) and crossup(C,dayopen) Then buy(); if MarketPosition == -1 and count >= 1 and crossup(C,dayopen+PriceScale*5) Then buy(); if (count < 1 or MarketPosition == 0) and crossdown(C,dayopen) Then sell(); if MarketPosition == 1 and count >= 1 and crossdown(C,dayopen-PriceScale*5) Then sell(); 위의 수식에서 추가수식 부탁합니다.. 1) 손절을 시가에서 +,- 10틱 2) 13:00분 까지는 익절을 10틱, 13시이후는 강제청산 설정시 설정을 따른다. 3) 일일 종가에는 청산한다. 고맙습니다... 부탁드립니다.