커뮤니티

문의드립니다.

프로필 이미지
잡다백수
2017-12-21 13:49:59
118
글번호 115166
답변완료
가상거래를 지표처럼 만들 수 있을까 해서 질문드립니다. 이렇게 생각을 해봤는데요 구현 가능할까요? 1. 지표 가상거래를 지표처럼 만들 수 있을까 해서 질문드립니다. 이렇게 생각을 해봤는데요 구현 가능할까요? a시점 = 전일 종가대비 n틱 이상 올랐을 때 a시점에서 고가대비 -n틱 이하로 가격이 떨어질 때까지 a시점대비 고가의 틱 차이 a시점에서 바로 고가대비-n틱으로 가격이 하향돌파했다면 고가를 높이지 못했으므로 틱은 0틱 a시점에서 고가가 1틱 올라간 상태에서 가격이 하향돌파했다면 1틱, 이후 오르는 만큼 틱수를 지표로. 2. 시스템 매수 전일종가대비 n틱 이상 올랐을 때 갭이라면 ATR로 목표가 청산+고가-ATR 트레일링 청산 갭이 아니라면 고가-ATR 트레일링 청산만 적용 매도는 반대 3. 시스템 a-전일 종가대비 n틱 이상 오른 상태에서 n틱이상 되돌림 발생하면 진입 매도는 반대 4. 시스템 전일종가대비 n틱이상 올랐을 때 갭이라면 수량 2로 ATR 목표가 청산 갭이 아니라면 수량1로 고가 -ATR 트레일링 청산만 적용 매도는 반대 5. 기타 if 매수조건 중괄호 {매수조건2}로 하는 거랑 if 매수조건 and 매수조건 하는 거랑 같나요? 또 buy(); exitshort(); 해놓는 거랑 리버스매매로 그냥 sell(); 하나만 해놓는 거랑 같나요? 비고 55978 55966 55938 재질문 답변 부탁드립니다.
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2017-12-21 16:29:56

안녕하세요 예스스탁입니다. 1. input : n1(10),n2(10); var : hh(0); if bdate != bdate[1] Then Condition1 = false; if Condition1 == false and H >= DayClose(1)*PriceScale*n1 Then{ Condition1 = true; HH = h; } if Condition1 == true Then{ if H > hh Then hh = h; if C <= HH-PriceScale*n2 Then Condition1 = false; } if Condition1 == true Then plot1((hh-DayClose(1)+PriceScale*n1)/PriceScale); Else plot1(0); 2 input : atrp(20), n1(5),n2(1),n3(1); var : atrv(0); atrv = atr(atrp); if NextBarSdate > sdate and NextBarOpen >= c+PriceScale*n1 Then buy("b1",AtMarket); if MarketPosition == 0 Then buy("b2",AtStop,DayClose(1)+PriceScale*n1); if MarketPosition == 1 Then{ ExitLong("btr",Atlimit,highest(H,BarsSinceEntry)-atrv*n3); if IsExitName("b1") == true Then ExitLong("bp",Atlimit,EntryPrice+atrv*n2); } if NextBarSdate > sdate and NextBarOpen <= c-PriceScale*n1 Then sell("s1",AtMarket); if MarketPosition == 0 Then sell("s2",AtStop,DayClose(1)+PriceScale*n1); if MarketPosition == -1 Then{ ExitShort("str",Atlimit,Lowest(L,BarsSinceEntry)+atrv*n3); if IsExitName("s1") == true Then ExitShort("sp",Atlimit,EntryPrice-atrv*n2); } 3 input : n1(10),n2(5); var : st(0),HH(0),LL(0); if bdate != bdate[1] then st = 0; if st <= 0 and crossup(H,DayClose(1)+PriceScale*n1) Then{ st = 1; HH = H; } if st >= 0 and CrossDown(L,DayClose(1)-PriceScale*n1) Then{ st = -1; LL = L; } if st == 1 then{ if H > HH Then HH = H; if MarketPosition <= 0 Then buy("b",AtStop,HH-PriceScale*n2); } if st == -1 then{ if L < LL Then LL = L; if MarketPosition >= 0 Then sell("s",AtStop,LL+PriceScale*n2); } 4 input : atrp(20), n1(5),n2(1),n3(1),수량1(1),수량2(2); var : atrv(0); atrv = atr(atrp); if NextBarSdate > sdate and NextBarOpen >= c+PriceScale*n1 Then buy("b1",AtMarket,def,수량2); if MarketPosition == 0 Then buy("b2",AtStop,DayClose(1)+PriceScale*n1,수량1); if MarketPosition == 1 Then{ if IsExitName("b2") == true Then ExitLong("btr",Atlimit,highest(H,BarsSinceEntry)-atrv*n3); if IsExitName("b1") == true Then ExitLong("bp",Atlimit,EntryPrice+atrv*n2); } if NextBarSdate > sdate and NextBarOpen <= c-PriceScale*n1 Then sell("s1",AtMarket,def,수량2); if MarketPosition == 0 Then sell("s2",AtStop,DayClose(1)+PriceScale*n1,수량1); if MarketPosition == -1 Then{ if IsExitName("s2") == true Then ExitShort("str",Atlimit,Lowest(L,BarsSinceEntry)+atrv*n3); if IsExitName("s1") == true Then ExitShort("sp",Atlimit,EntryPrice-atrv*n2); } 5 여러 조건을 and로 연결하시는것 (조건1 and 조건2 )과 if문으로 연결해 중괄호로 묶어주시는 것은 같습니다. if 조건1 then{ if 조건2 then{ } } 6. 55978 55966 55938 위 내용에 대해서는 전화를 주시기 바랍니다. 02-3453-1060 즐거운 하루되세요 > 잡다백수 님이 쓴 글입니다. > 제목 : 문의드립니다. > 가상거래를 지표처럼 만들 수 있을까 해서 질문드립니다. 이렇게 생각을 해봤는데요 구현 가능할까요? 1. 지표 가상거래를 지표처럼 만들 수 있을까 해서 질문드립니다. 이렇게 생각을 해봤는데요 구현 가능할까요? a시점 = 전일 종가대비 n틱 이상 올랐을 때 a시점에서 고가대비 -n틱 이하로 가격이 떨어질 때까지 a시점대비 고가의 틱 차이 a시점에서 바로 고가대비-n틱으로 가격이 하향돌파했다면 고가를 높이지 못했으므로 틱은 0틱 a시점에서 고가가 1틱 올라간 상태에서 가격이 하향돌파했다면 1틱, 이후 오르는 만큼 틱수를 지표로. 2. 시스템 매수 전일종가대비 n틱 이상 올랐을 때 갭이라면 ATR로 목표가 청산+고가-ATR 트레일링 청산 갭이 아니라면 고가-ATR 트레일링 청산만 적용 매도는 반대 3. 시스템 a-전일 종가대비 n틱 이상 오른 상태에서 n틱이상 되돌림 발생하면 진입 매도는 반대 4. 시스템 전일종가대비 n틱이상 올랐을 때 갭이라면 수량 2로 ATR 목표가 청산 갭이 아니라면 수량1로 고가 -ATR 트레일링 청산만 적용 매도는 반대 5. 기타 if 매수조건 중괄호 {매수조건2}로 하는 거랑 if 매수조건 and 매수조건 하는 거랑 같나요? 또 buy(); exitshort(); 해놓는 거랑 리버스매매로 그냥 sell(); 하나만 해놓는 거랑 같나요? 비고 55978 55966 55938 재질문 답변 부탁드립니다.
프로필 이미지

잡다백수

2017-12-21 20:05:06

코딩감사합니다. 재질문드립니다. input : atrp(20), n1(5),n2(1),n3(1),수량1(1),수량2(2); var : atrv(0); atrv = atr(atrp); if NextBarSdate > sdate and NextBarOpen >= c+PriceScale*n1 Then buy("b1",AtMarket,def,수량2); if MarketPosition == 0 Then buy("b2",AtStop,DayClose(1)+PriceScale*n1,수량1); if MarketPosition == 1 Then{ if IsExitName("b2") == true Then ExitLong("btr",Atlimit,highest(H,BarsSinceEntry)-atrv*n3); if IsExitName("b1") == true Then ExitLong("bp",Atlimit,EntryPrice+atrv*n2); } if NextBarSdate > sdate and NextBarOpen <= c-PriceScale*n1 Then sell("s1",AtMarket,def,수량2); if MarketPosition == 0 Then sell("s2",AtStop,DayClose(1)+PriceScale*n1,수량1); if MarketPosition == -1 Then{ if IsExitName("s2") == true Then ExitShort("str",Atlimit,Lowest(L,BarsSinceEntry)+atrv*n3); if IsExitName("s1") == true Then ExitShort("sp",Atlimit,EntryPrice-atrv*n2); } 실행해보니 갭상승한 날은 갭 진입과 그냥 진입이 동시에 되던데요. (수량 3진입) 이걸 갭상승한 날은 갭 진입만 들어가게 할 수는 없을까요? > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다. > 안녕하세요 예스스탁입니다. 1. input : n1(10),n2(10); var : hh(0); if bdate != bdate[1] Then Condition1 = false; if Condition1 == false and H >= DayClose(1)*PriceScale*n1 Then{ Condition1 = true; HH = h; } if Condition1 == true Then{ if H > hh Then hh = h; if C <= HH-PriceScale*n2 Then Condition1 = false; } if Condition1 == true Then plot1((hh-DayClose(1)+PriceScale*n1)/PriceScale); Else plot1(0); 2 input : atrp(20), n1(5),n2(1),n3(1); var : atrv(0); atrv = atr(atrp); if NextBarSdate > sdate and NextBarOpen >= c+PriceScale*n1 Then buy("b1",AtMarket); if MarketPosition == 0 Then buy("b2",AtStop,DayClose(1)+PriceScale*n1); if MarketPosition == 1 Then{ ExitLong("btr",Atlimit,highest(H,BarsSinceEntry)-atrv*n3); if IsExitName("b1") == true Then ExitLong("bp",Atlimit,EntryPrice+atrv*n2); } if NextBarSdate > sdate and NextBarOpen <= c-PriceScale*n1 Then sell("s1",AtMarket); if MarketPosition == 0 Then sell("s2",AtStop,DayClose(1)+PriceScale*n1); if MarketPosition == -1 Then{ ExitShort("str",Atlimit,Lowest(L,BarsSinceEntry)+atrv*n3); if IsExitName("s1") == true Then ExitShort("sp",Atlimit,EntryPrice-atrv*n2); } 3 input : n1(10),n2(5); var : st(0),HH(0),LL(0); if bdate != bdate[1] then st = 0; if st <= 0 and crossup(H,DayClose(1)+PriceScale*n1) Then{ st = 1; HH = H; } if st >= 0 and CrossDown(L,DayClose(1)-PriceScale*n1) Then{ st = -1; LL = L; } if st == 1 then{ if H > HH Then HH = H; if MarketPosition <= 0 Then buy("b",AtStop,HH-PriceScale*n2); } if st == -1 then{ if L < LL Then LL = L; if MarketPosition >= 0 Then sell("s",AtStop,LL+PriceScale*n2); } 4 input : atrp(20), n1(5),n2(1),n3(1),수량1(1),수량2(2); var : atrv(0); atrv = atr(atrp); if NextBarSdate > sdate and NextBarOpen >= c+PriceScale*n1 Then buy("b1",AtMarket,def,수량2); if MarketPosition == 0 Then buy("b2",AtStop,DayClose(1)+PriceScale*n1,수량1); if MarketPosition == 1 Then{ if IsExitName("b2") == true Then ExitLong("btr",Atlimit,highest(H,BarsSinceEntry)-atrv*n3); if IsExitName("b1") == true Then ExitLong("bp",Atlimit,EntryPrice+atrv*n2); } if NextBarSdate > sdate and NextBarOpen <= c-PriceScale*n1 Then sell("s1",AtMarket,def,수량2); if MarketPosition == 0 Then sell("s2",AtStop,DayClose(1)+PriceScale*n1,수량1); if MarketPosition == -1 Then{ if IsExitName("s2") == true Then ExitShort("str",Atlimit,Lowest(L,BarsSinceEntry)+atrv*n3); if IsExitName("s1") == true Then ExitShort("sp",Atlimit,EntryPrice-atrv*n2); } 5 여러 조건을 and로 연결하시는것 (조건1 and 조건2 )과 if문으로 연결해 중괄호로 묶어주시는 것은 같습니다. if 조건1 then{ if 조건2 then{ } } 6. 55978 55966 55938 위 내용에 대해서는 전화를 주시기 바랍니다. 02-3453-1060 즐거운 하루되세요 > 잡다백수 님이 쓴 글입니다. > 제목 : 문의드립니다. > 가상거래를 지표처럼 만들 수 있을까 해서 질문드립니다. 이렇게 생각을 해봤는데요 구현 가능할까요? 1. 지표 가상거래를 지표처럼 만들 수 있을까 해서 질문드립니다. 이렇게 생각을 해봤는데요 구현 가능할까요? a시점 = 전일 종가대비 n틱 이상 올랐을 때 a시점에서 고가대비 -n틱 이하로 가격이 떨어질 때까지 a시점대비 고가의 틱 차이 a시점에서 바로 고가대비-n틱으로 가격이 하향돌파했다면 고가를 높이지 못했으므로 틱은 0틱 a시점에서 고가가 1틱 올라간 상태에서 가격이 하향돌파했다면 1틱, 이후 오르는 만큼 틱수를 지표로. 2. 시스템 매수 전일종가대비 n틱 이상 올랐을 때 갭이라면 ATR로 목표가 청산+고가-ATR 트레일링 청산 갭이 아니라면 고가-ATR 트레일링 청산만 적용 매도는 반대 3. 시스템 a-전일 종가대비 n틱 이상 오른 상태에서 n틱이상 되돌림 발생하면 진입 매도는 반대 4. 시스템 전일종가대비 n틱이상 올랐을 때 갭이라면 수량 2로 ATR 목표가 청산 갭이 아니라면 수량1로 고가 -ATR 트레일링 청산만 적용 매도는 반대 5. 기타 if 매수조건 중괄호 {매수조건2}로 하는 거랑 if 매수조건 and 매수조건 하는 거랑 같나요? 또 buy(); exitshort(); 해놓는 거랑 리버스매매로 그냥 sell(); 하나만 해놓는 거랑 같나요? 비고 55978 55966 55938 재질문 답변 부탁드립니다.