커뮤니티

추가 매수가 되지 않아요 수식 검토 부탁드리겠습니다.

프로필 이미지
이형지
2023-09-24 14:14:29
852
글번호 171247
답변완료
아래수식으로 구현했는데 최초 1차 매수는 되는데.. 하락시 추가적인 매수가 진행되지 않습니다. 피라미딩도 모든 진입신호 허용 으로 했는데도 안되네요... 한번 체크 부탁드릴께요~~ 적용조건은 다음과 같습니다. 예스트레이드(예스스탁) 삼성전자 60분봉 매수조건 600이평 아래시 최초 매수 10주 최초 매수금액에서 -5%하락시 20주 매수 최초 매수금액에서 -10%하락시 30주 매수 최초 매수금액에서 -15%하락시 40주 매수 최초 매수금액에서 -20%하락시 50주 매수 최초 매수금액에서 -25%하락시 60주 매수 그리고 평균매수가의 1% 수익시마다 분할매도되는 수식입니다. input : p(600); var : XV(0),Vol(0),cond(False); var1 = ma(C,P); if MarketPosition == 0 and CrossDown(C,var1) Then { Buy("b1",OnClose,Def,10); Buy("b2.",AtLimit,C*0.95,20); Buy("b3.",AtLimit,C*0.9,30); Buy("b4.",AtLimit,C*0.85,40); Buy("b5.",AtLimit,C*0.8,50); Buy("b6.",AtLimit,C*0.75,60); } if MarketPosition == 1 Then { if lowest(L,BarsSinceEntry) > EntryPrice*0.95 Then Buy("b2",AtLimit,C*0.95,20); if lowest(L,BarsSinceEntry) > EntryPrice*0.9 Then Buy("b3",AtLimit,C*0.9,30); if lowest(L,BarsSinceEntry) > EntryPrice*0.85 Then Buy("b4",AtLimit,C*0.85,40); if lowest(L,BarsSinceEntry) > EntryPrice*0.8 Then Buy("b5",AtLimit,C*0.8,50); if lowest(L,BarsSinceEntry) > EntryPrice*0.75 Then Buy("b6",AtLimit,C*0.75,60); if CurrentContracts > CurrentContracts[1] Then { XV = CurrentContracts; cond = False; } if C >= AvgEntryPrice*(1+1.01) and sTime == 110000 Then { if XV >= 100 Then vol = Floor(XV*0.01); # 계약수가 100개 이상일때 1% 분할매도 else if XV < 100 and XV >= 50 Then vol = Floor(XV*0.02); # 계약수가 50개~100 일때 2% 분할매도 else if XV < 50 and XV >= 20 Then vol = Floor(XV*0.05); # 계약수가 20개~50 일때 5% 분할매도 else if XV < 20 and XV >= 10 Then vol = Floor(XV*0.10); # 계약수가 10개~20 일때 10% 분할매도 Else vol = Floor(XV*0.50); # 계약수가 10개이하 일때 50% 분할매도 ExitLong("bx",OnClose,Def,"",vol,2); } } Else cond = False; ---------------------------------------------------------------------------- 500이평선 하락시 하락퍼센트마다 진입 버전 2023.09.01 # 하락시 분할매수 전략 // 분할매도 input : 시작일(20230901); input : p(500); input : 수익퍼센트(10); var : XV(0),Vol(0),cond(False); var1 = ma(C,P); if Data1(sDate) >= 시작일 Then { if MarketPosition == 0 and CrossDown(C,var1) Then { Buy("b1",OnClose,Def,10); Buy("b2.",AtLimit,C*0.95,20); Buy("b3.",AtLimit,C*0.9,30); Buy("b4.",AtLimit,C*0.85,40); Buy("b5.",AtLimit,C*0.8,50); Buy("b6.",AtLimit,C*0.75,60); } if MarketPosition == 1 Then { if lowest(L,BarsSinceEntry) > EntryPrice*0.97 Then Buy("b2",AtLimit,EntryPrice*0.97,15); if lowest(L,BarsSinceEntry) > EntryPrice*0.94 Then Buy("b3",AtLimit,EntryPrice*0.94,20); if lowest(L,BarsSinceEntry) > EntryPrice*0.91 Then Buy("b4",AtLimit,EntryPrice*0.91,25); if lowest(L,BarsSinceEntry) > EntryPrice*0.88 Then Buy("b5",AtLimit,EntryPrice*0.88,30); if lowest(L,BarsSinceEntry) > EntryPrice*0.85 Then Buy("b6",AtLimit,EntryPrice*0.85,35); if lowest(L,BarsSinceEntry) > EntryPrice*0.82 Then Buy("b7",AtLimit,EntryPrice*0.82,40); if lowest(L,BarsSinceEntry) > EntryPrice*0.79 Then Buy("b8",AtLimit,EntryPrice*0.79,45); if lowest(L,BarsSinceEntry) > EntryPrice*0.76 Then Buy("b9",AtLimit,EntryPrice*0.76,50); if lowest(L,BarsSinceEntry) > EntryPrice*0.73 Then Buy("b10",AtLimit,EntryPrice*0.73,55); if lowest(L,BarsSinceEntry) > EntryPrice*0.7 Then Buy("b11",AtLimit,EntryPrice*0.7,60); if lowest(L,BarsSinceEntry) > EntryPrice*0.67 Then Buy("b12",AtLimit,EntryPrice*0.67,65); if lowest(L,BarsSinceEntry) > EntryPrice*0.64 Then Buy("b13",AtLimit,EntryPrice*0.64,70); if lowest(L,BarsSinceEntry) > EntryPrice*0.61 Then Buy("b14",AtLimit,EntryPrice*0.61,75); if lowest(L,BarsSinceEntry) > EntryPrice*0.58 Then Buy("b15",AtLimit,EntryPrice*0.58,80); if lowest(L,BarsSinceEntry) > EntryPrice*0.55 Then Buy("b16",AtLimit,EntryPrice*0.55,85); if lowest(L,BarsSinceEntry) > EntryPrice*0.50 Then Buy("b17",AtLimit,EntryPrice*0.50,90); if lowest(L,BarsSinceEntry) > EntryPrice*0.45 Then Buy("b18",AtLimit,EntryPrice*0.45,100); if lowest(L,BarsSinceEntry) > EntryPrice*0.4 Then Buy("b19",AtLimit,EntryPrice*0.4,110); if lowest(L,BarsSinceEntry) > EntryPrice*0.35 Then Buy("b20",AtLimit,EntryPrice*0.35,120); if lowest(L,BarsSinceEntry) > EntryPrice*0.3 Then Buy("b21",AtLimit,EntryPrice*0.3,130); if lowest(L,BarsSinceEntry) > EntryPrice*0.25 Then Buy("b22",AtLimit,EntryPrice*0.25,140); if lowest(L,BarsSinceEntry) > EntryPrice*0.2 Then Buy("b23",AtLimit,EntryPrice*0.2,150); if lowest(L,BarsSinceEntry) > EntryPrice*0.15 Then Buy("b24",AtLimit,EntryPrice*0.15,160); if lowest(L,BarsSinceEntry) > EntryPrice*0.1 Then Buy("b25",AtLimit,EntryPrice*0.1,170); if lowest(L,BarsSinceEntry) > EntryPrice*0.05 Then Buy("b26",AtLimit,EntryPrice*0.05,180); if CurrentContracts > CurrentContracts[1] Then { XV = CurrentContracts; cond = False; } } if C >= AvgEntryPrice*(1+수익퍼센트*0.01) and sTime == 110000 Then { if XV >= 100 Then vol = Floor(XV*0.01); # 계약수가 100개 이상일때 1% 분할매도 else if XV < 100 and XV >= 50 Then vol = Floor(XV*0.02); # 계약수가 50개~100 일때 2% 분할매도 else if XV < 50 and XV >= 20 Then vol = Floor(XV*0.05); # 계약수가 20개~50 일때 5% 분할매도 else if XV < 20 and XV >= 10 Then vol = Floor(XV*0.10); # 계약수가 10개~20 일때 10% 분할매도 Else vol = Floor(XV*0.50); # 계약수가 10개이하 일때 50% 분할매도 ExitLong("bx",OnClose,Def,"",vol,2); } } Else cond = False;
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2023-08-07 16:51:10

안녕하세용 예스스탁입니다. if lowest(L,BarsSinceEntry) > EntryPrice*0.95 Then Buy("b2",AtLimit,EntryPrice*0.95,20); if lowest(L,BarsSinceEntry) > EntryPrice*0.9 Then Buy("b3",AtLimit,EntryPrice*0.9,30); if lowest(L,BarsSinceEntry) > EntryPrice*0.85 Then Buy("b4",AtLimit,EntryPrice*0.85,40); if lowest(L,BarsSinceEntry) > EntryPrice*0.8 Then Buy("b5",AtLimit,EntryPrice*0.8,50); if lowest(L,BarsSinceEntry) > EntryPrice*0.75 Then Buy("b6",AtLimit,EntryPrice*0.75,60) 위 부분은 c가 아닌 EntryPrice로 지정되어 있어야 했습니다. 수정한 식입니다. input : p(600); var : XV(0),Vol(0),cond(False); var1 = ma(C,P); if MarketPosition == 0 and CrossDown(C,var1) Then { Buy("b1",OnClose,Def,10); Buy("b2.",AtLimit,C*0.95,20); Buy("b3.",AtLimit,C*0.9,30); Buy("b4.",AtLimit,C*0.85,40); Buy("b5.",AtLimit,C*0.8,50); Buy("b6.",AtLimit,C*0.75,60); } if MarketPosition == 1 Then { if lowest(L,BarsSinceEntry) > EntryPrice*0.95 Then Buy("b2",AtLimit,EntryPrice*0.95,20); if lowest(L,BarsSinceEntry) > EntryPrice*0.9 Then Buy("b3",AtLimit,EntryPrice*0.9,30); if lowest(L,BarsSinceEntry) > EntryPrice*0.85 Then Buy("b4",AtLimit,EntryPrice*0.85,40); if lowest(L,BarsSinceEntry) > EntryPrice*0.8 Then Buy("b5",AtLimit,EntryPrice*0.8,50); if lowest(L,BarsSinceEntry) > EntryPrice*0.75 Then Buy("b6",AtLimit,EntryPrice*0.75,60); if CurrentContracts > CurrentContracts[1] Then { XV = CurrentContracts; cond = False; } if C >= AvgEntryPrice*(1+1.01) and sTime == 110000 Then { if XV >= 100 Then vol = Floor(XV*0.01); # 계약수가 100개 이상일때 1% 분할매도 else if XV < 100 and XV >= 50 Then vol = Floor(XV*0.02); # 계약수가 50개~100 일때 2% 분할매도 else if XV < 50 and XV >= 20 Then vol = Floor(XV*0.05); # 계약수가 20개~50 일때 5% 분할매도 else if XV < 20 and XV >= 10 Then vol = Floor(XV*0.10); # 계약수가 10개~20 일때 10% 분할매도 Else vol = Floor(XV*0.50); # 계약수가 10개이하 일때 50% 분할매도 ExitLong("bx",OnClose,Def,"",vol,2); } } Else cond = False; 즐거운 하루되세요 > 이형지 님이 쓴 글입니다. > 제목 : 추가 매수가 되지 않아요 수식 검토 부탁드리겠습니다. > 아래수식으로 구현했는데 최초 1차 매수는 되는데.. 하락시 추가적인 매수가 진행되지 않습니다. 피라미딩도 모든 진입신호 허용 으로 했는데도 안되네요... 한번 체크 부탁드릴께요~~ 적용조건은 다음과 같습니다. 예스트레이드(예스스탁) 삼성전자 60분봉 매수조건 600이평 아래시 최초 매수 10주 최초 매수금액에서 -5%하락시 20주 매수 최초 매수금액에서 -10%하락시 30주 매수 최초 매수금액에서 -15%하락시 40주 매수 최초 매수금액에서 -20%하락시 50주 매수 최초 매수금액에서 -25%하락시 60주 매수 그리고 평균매수가의 1% 수익시마다 분할매도되는 수식입니다. input : p(600); var : XV(0),Vol(0),cond(False); var1 = ma(C,P); if MarketPosition == 0 and CrossDown(C,var1) Then { Buy("b1",OnClose,Def,10); Buy("b2.",AtLimit,C*0.95,20); Buy("b3.",AtLimit,C*0.9,30); Buy("b4.",AtLimit,C*0.85,40); Buy("b5.",AtLimit,C*0.8,50); Buy("b6.",AtLimit,C*0.75,60); } if MarketPosition == 1 Then { if lowest(L,BarsSinceEntry) > EntryPrice*0.95 Then Buy("b2",AtLimit,C*0.95,20); if lowest(L,BarsSinceEntry) > EntryPrice*0.9 Then Buy("b3",AtLimit,C*0.9,30); if lowest(L,BarsSinceEntry) > EntryPrice*0.85 Then Buy("b4",AtLimit,C*0.85,40); if lowest(L,BarsSinceEntry) > EntryPrice*0.8 Then Buy("b5",AtLimit,C*0.8,50); if lowest(L,BarsSinceEntry) > EntryPrice*0.75 Then Buy("b6",AtLimit,C*0.75,60); if CurrentContracts > CurrentContracts[1] Then { XV = CurrentContracts; cond = False; } if C >= AvgEntryPrice*(1+1.01) and sTime == 110000 Then { if XV >= 100 Then vol = Floor(XV*0.01); # 계약수가 100개 이상일때 1% 분할매도 else if XV < 100 and XV >= 50 Then vol = Floor(XV*0.02); # 계약수가 50개~100 일때 2% 분할매도 else if XV < 50 and XV >= 20 Then vol = Floor(XV*0.05); # 계약수가 20개~50 일때 5% 분할매도 else if XV < 20 and XV >= 10 Then vol = Floor(XV*0.10); # 계약수가 10개~20 일때 10% 분할매도 Else vol = Floor(XV*0.50); # 계약수가 10개이하 일때 50% 분할매도 ExitLong("bx",OnClose,Def,"",vol,2); } } Else cond = False;