커뮤니티

시스템 수정

프로필 이미지
쭈니오빠
2021-01-04 22:41:44
722
글번호 145096
답변완료
안녕하세요 동일한 시스템으로 자주 질문드려 죄송합니다. 수식에 대한 이해도가 떨어지다보니 정확히 어떤부분에 문제가 있어서 제가 의도한 대로 동작하지 않는지 찾아내기가 쉽지 않네요 매수 4,5,6 매수신호 이후에 제가 원하는 위치에서 매수 4,5,6이 나오지 않아서,, 아마 매수 4,5,6 신호 이후에는 더 하락해야 매수가 되도록 설정되어 있는것이 아닌가 싶은데요,,, 그것이 맞다면 변경부탁드릴게요 감사합니다. INPUT : 매수(0), 매도조건(1); var : cond(False),LP(0); var1 = ma(C,3); var2 = ma(C,5); var3 = ma(C,10); var4 = ma(C,60); value1 = 0; if value1 == 0 and C < Var4 and CrossDown(c,var3) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수3"); } } if value1 == 0 and C < var4 and CrossDown(c,var2) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수2"); } } if value1 == 0 and C < Var4 and CrossDown(c,var1) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수1"); } } if MarketPosition == 1 Then { if 매수 == 1 Then Cond = true; if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수1" Then { LP = LatestEntryPrice(0); Condition1 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수2" Then { LP = LatestEntryPrice(0); Condition2 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수3" Then { LP = LatestEntryPrice(0); Condition3 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수4" Then { LP = LatestEntryPrice(0); Condition4 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수5" Then { LP = LatestEntryPrice(0); Condition5 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수6" Then { LP = LatestEntryPrice(0); Condition6 = true; } if Condition3 == true Then { if Condition4 == False Then Buy("매수4",AtLimit,LP*0.97); if Condition4 == true and Condition5 == False Then Buy("매수5",AtLimit,LP*0.95); if Condition4 == true and Condition5 == true and Condition6 == False Then Buy("매수6",AtLimit,LP*0.90); } if 매도조건 == 1 Then { ExitLong("bx1",AtLimit,AvgEntryPrice*1.05,"",Floor(MaxContracts*0.2),1); ExitLong("bx2",AtLimit,AvgEntryPrice*1.08,"",Floor(MaxContracts*0.5),1); ExitLong("bx3",AtLimit,AvgEntryPrice*1.10); } if 매도조건 == 2 Then { ExitLong("bx",AtLimit,AvgEntryPrice*1.15); } } Else { Condition1 = False; Condition2 = False; Condition3 = False; }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-01-05 14:01:32

안녕하세요 예스스탁입니다. 1번식은 매수1,매수2,매수3 중에 한개이상 진입하고 최저가 진입가에서 3%,5%,10%에서 매수4,매수5,매수6으로 추가 진입합니다. 만약 매수1,매수2,매수3이 모두 진입한 이후에 3개진입의 최저가에서 3%,5%,10%에서 매수4,매수5,매수6으로 추가 진입을 원하시면 2번식 이용하시면 됩니다. 1 INPUT : 매수(0), 매도조건(1); var : cond(False),LP(0); var1 = ma(C,3); var2 = ma(C,5); var3 = ma(C,10); var4 = ma(C,60); value1 = 0; if value1 == 0 and C < Var4 and CrossDown(c,var3) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수3"); } } if value1 == 0 and C < var4 and CrossDown(c,var2) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수2"); } } if value1 == 0 and C < Var4 and CrossDown(c,var1) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수1"); } } if MarketPosition == 1 Then { if 매수 == 1 Then Cond = true; if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수1" Then { if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then LP = LatestEntryPrice(0); Condition1 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수2" Then { if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then LP = LatestEntryPrice(0); Condition2 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수3" Then { if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then LP = LatestEntryPrice(0); Condition3 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수4" Then { Condition4 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수5" Then { Condition5 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수6" Then { Condition6 = true; } if Condition3 == true or Condition2 == true or Condition1 == true Then { if Condition4 == False Then Buy("매수4",AtLimit,LP*0.97); if Condition4 == true and Condition5 == False Then Buy("매수5",AtLimit,LP*0.95); if Condition4 == true and Condition5 == true and Condition6 == False Then Buy("매수6",AtLimit,LP*0.90); } if 매도조건 == 1 Then { ExitLong("bx1",AtLimit,AvgEntryPrice*1.05,"",Floor(MaxContracts*0.2),1); ExitLong("bx2",AtLimit,AvgEntryPrice*1.08,"",Floor(MaxContracts*0.5),1); ExitLong("bx3",AtLimit,AvgEntryPrice*1.10); } if 매도조건 == 2 Then { ExitLong("bx",AtLimit,AvgEntryPrice*1.15); } } Else { LP = 0; Condition1 = False; Condition2 = False; Condition3 = False; Condition4 = False; Condition5 = False; Condition6 = False; } 2 INPUT : 매수(0), 매도조건(1); var : cond(False),LP(0); var1 = ma(C,3); var2 = ma(C,5); var3 = ma(C,10); var4 = ma(C,60); value1 = 0; if value1 == 0 and C < Var4 and CrossDown(c,var3) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수3"); } } if value1 == 0 and C < var4 and CrossDown(c,var2) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수2"); } } if value1 == 0 and C < Var4 and CrossDown(c,var1) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수1"); } } if MarketPosition == 1 Then { if 매수 == 1 Then Cond = true; if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수1" Then { if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then LP = LatestEntryPrice(0); Condition1 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수2" Then { if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then LP = LatestEntryPrice(0); Condition2 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수3" Then { if LP == 0 or (LP > 0 and LatestEntryPrice(0) < LP) Then LP = LatestEntryPrice(0); Condition3 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수4" Then { Condition4 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수5" Then { Condition5 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수6" Then { Condition6 = true; } if Condition3 == true and Condition2 == true and Condition1 == true Then { if Condition4 == False Then Buy("매수4",AtLimit,LP*0.97); if Condition4 == true and Condition5 == False Then Buy("매수5",AtLimit,LP*0.95); if Condition4 == true and Condition5 == true and Condition6 == False Then Buy("매수6",AtLimit,LP*0.90); } if 매도조건 == 1 Then { ExitLong("bx1",AtLimit,AvgEntryPrice*1.05,"",Floor(MaxContracts*0.2),1); ExitLong("bx2",AtLimit,AvgEntryPrice*1.08,"",Floor(MaxContracts*0.5),1); ExitLong("bx3",AtLimit,AvgEntryPrice*1.10); } if 매도조건 == 2 Then { ExitLong("bx",AtLimit,AvgEntryPrice*1.15); } } Else { LP = 0; Condition1 = False; Condition2 = False; Condition3 = False; Condition4 = False; Condition5 = False; Condition6 = False; } 즐거운 하루되세요 > 쭈니오빠 님이 쓴 글입니다. > 제목 : 시스템 수정 > 안녕하세요 동일한 시스템으로 자주 질문드려 죄송합니다. 수식에 대한 이해도가 떨어지다보니 정확히 어떤부분에 문제가 있어서 제가 의도한 대로 동작하지 않는지 찾아내기가 쉽지 않네요 매수 4,5,6 매수신호 이후에 제가 원하는 위치에서 매수 4,5,6이 나오지 않아서,, 아마 매수 4,5,6 신호 이후에는 더 하락해야 매수가 되도록 설정되어 있는것이 아닌가 싶은데요,,, 그것이 맞다면 변경부탁드릴게요 감사합니다. INPUT : 매수(0), 매도조건(1); var : cond(False),LP(0); var1 = ma(C,3); var2 = ma(C,5); var3 = ma(C,10); var4 = ma(C,60); value1 = 0; if value1 == 0 and C < Var4 and CrossDown(c,var3) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수3"); } } if value1 == 0 and C < var4 and CrossDown(c,var2) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수2"); } } if value1 == 0 and C < Var4 and CrossDown(c,var1) and cond == False Then { if MarketPosition == 0 or (MarketPosition == 1 and C < LP and Condition1 == False) Then { value1 = 1; Buy("매수1"); } } if MarketPosition == 1 Then { if 매수 == 1 Then Cond = true; if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수1" Then { LP = LatestEntryPrice(0); Condition1 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수2" Then { LP = LatestEntryPrice(0); Condition2 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수3" Then { LP = LatestEntryPrice(0); Condition3 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수4" Then { LP = LatestEntryPrice(0); Condition4 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수5" Then { LP = LatestEntryPrice(0); Condition5 = true; } if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수6" Then { LP = LatestEntryPrice(0); Condition6 = true; } if Condition3 == true Then { if Condition4 == False Then Buy("매수4",AtLimit,LP*0.97); if Condition4 == true and Condition5 == False Then Buy("매수5",AtLimit,LP*0.95); if Condition4 == true and Condition5 == true and Condition6 == False Then Buy("매수6",AtLimit,LP*0.90); } if 매도조건 == 1 Then { ExitLong("bx1",AtLimit,AvgEntryPrice*1.05,"",Floor(MaxContracts*0.2),1); ExitLong("bx2",AtLimit,AvgEntryPrice*1.08,"",Floor(MaxContracts*0.5),1); ExitLong("bx3",AtLimit,AvgEntryPrice*1.10); } if 매도조건 == 2 Then { ExitLong("bx",AtLimit,AvgEntryPrice*1.15); } } Else { Condition1 = False; Condition2 = False; Condition3 = False; }