커뮤니티

문의

프로필 이미지
목마와숙녀
2022-03-04 05:12:15
1055
글번호 156922
답변완료
아래 수식으로 스위칭 거래를 하고 싶습니다. 요청사항 1.총거래횟수는 max 6회입니다. 2.거래순서를 정하고 싶습니다. 3.요청수식은 2가지 입니다. a)방식 : b1,b2,b3(s1,s2,s3) 순서를 지킴 buy거래 후 반드시 sell 거래 / sell 거래 후 반드시 buy 거래 - buy 거래가 먼저 시작하면 (b1 - s1 - b2 - s2 - b3 - s3) - sell 거래가 먼저 시작하면 (s1 - b1 - s2 - b2 - s3 - b3) b)방식 : b1,b2,b3(s1,s2,s3) 순서를 지킴 같은 방향 신호가 와도 진입 가능 (b1 - b2 - s1 - s2 - b3 - s3) (s1 - s2 - b1 - b2 - s3 - b3) var : entry(0),T1(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; 참고로 진입명별로 1회씩 들어가게 위 수식을 사용했으나 max 6회를 하지 않고 하루에 1회만 거래하는 경우도 발생하니 바른 수식으로 수정 바랍니다. 항상 고맙습니다. *********************************************************************************** input : n1(1),fs1(50),n2(1),fs2(100),n3(1),fs3(150); input : n4(1),ff1(50),n5(1),ff2(100),n6(1),ff3(150); var : entry(0),T1(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; if data2(c>lowD(0)+fs1) and entry < n1 Then Buy("b1"); if data2(c>lowD(0)+fs2) and entry < n2 Then Buy("b2"); if data2(c>lowD(0)+fs3) and entry < n3 Then Buy("b3"); if data3(c<HighD(0)-ff1) and entry < n4 Then Sell("s1"); if data3(c<HighD(0)-ff2) and entry < n5 Then Sell("s2"); if data3(c<HighD(0)-ff3) and entry < n6 Then Sell("s3");
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-03-04 11:49:49

안녕하세요 예스스탁입니다. 1 input : fs1(50),fs2(100),fs3(150); input : ff1(50),ff2(100),ff3(150); var : T(0,Data1),B(0,Data1),S(0,Data1); if data1(Bdate != Bdate[1]) Then { T = 0; B = 0; S = 0; } if MarketPosition <= 0 and T <= 0 and data2(c>lowD(0)+fs1) and B == 0 Then { T = 1; B = 1; Buy("b1"); } if MarketPosition <= 0 and T <= 0 and data2(c>lowD(0)+fs2) and B == 1 Then { T = 1; B = 2; Buy("b2"); } if MarketPosition <= 0 and T <= 0 and data2(c>lowD(0)+fs3) and B == 2 Then { T = 1; B = 3; Buy("b3"); } if MarketPosition >= 0 and T >= 0 and data3(c<HighD(0)-ff1) and S == 0 Then { T = -1; S = 1; Sell("s1"); } if MarketPosition >= 0 and T >= 0 and data3(c<HighD(0)-ff2) and S == 1 Then { T = -1; S = 2; Sell("s2"); } if MarketPosition >= 0 and T >= 0 and data3(c<HighD(0)-ff3) and S == 2 Then { T = -1; S = 3; Sell("s3"); } 2 input : fs1(50),fs2(100),fs3(150); input : ff1(50),ff2(100),ff3(150); var : B(0,Data1),S(0,Data1); if data1(Bdate != Bdate[1]) Then { B = 0; S = 0; } if data2(c>lowD(0)+fs1) and B == 0 Then { B = 1; Buy("b1"); } if data2(c>lowD(0)+fs2) and B == 1 Then { B = 2; Buy("b2"); } if data2(c>lowD(0)+fs3) and B == 2 Then { B = 3; Buy("b3"); } if data3(c<HighD(0)-ff1) and S == 0 Then { S = 1; Sell("s1"); } if data3(c<HighD(0)-ff2) and S == 1 Then { S = 2; Sell("s2"); } if data3(c<HighD(0)-ff3) and S == 2 Then { S = 3; Sell("s3"); } 즐거운 하루되세요 > 목마와숙녀 님이 쓴 글입니다. > 제목 : 문의 > 아래 수식으로 스위칭 거래를 하고 싶습니다. 요청사항 1.총거래횟수는 max 6회입니다. 2.거래순서를 정하고 싶습니다. 3.요청수식은 2가지 입니다. a)방식 : b1,b2,b3(s1,s2,s3) 순서를 지킴 buy거래 후 반드시 sell 거래 / sell 거래 후 반드시 buy 거래 - buy 거래가 먼저 시작하면 (b1 - s1 - b2 - s2 - b3 - s3) - sell 거래가 먼저 시작하면 (s1 - b1 - s2 - b2 - s3 - b3) b)방식 : b1,b2,b3(s1,s2,s3) 순서를 지킴 같은 방향 신호가 와도 진입 가능 (b1 - b2 - s1 - s2 - b3 - s3) (s1 - s2 - b1 - b2 - s3 - b3) var : entry(0),T1(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; 참고로 진입명별로 1회씩 들어가게 위 수식을 사용했으나 max 6회를 하지 않고 하루에 1회만 거래하는 경우도 발생하니 바른 수식으로 수정 바랍니다. 항상 고맙습니다. *********************************************************************************** input : n1(1),fs1(50),n2(1),fs2(100),n3(1),fs3(150); input : n4(1),ff1(50),n5(1),ff2(100),n6(1),ff3(150); var : entry(0),T1(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; if data2(c>lowD(0)+fs1) and entry < n1 Then Buy("b1"); if data2(c>lowD(0)+fs2) and entry < n2 Then Buy("b2"); if data2(c>lowD(0)+fs3) and entry < n3 Then Buy("b3"); if data3(c<HighD(0)-ff1) and entry < n4 Then Sell("s1"); if data3(c<HighD(0)-ff2) and entry < n5 Then Sell("s2"); if data3(c<HighD(0)-ff3) and entry < n6 Then Sell("s3");