커뮤니티

문의드립니다.

프로필 이미지
깜피
2021-08-20 07:00:18
1267
글번호 151634
답변완료
안녕하세요. 시스템 개발에 많은 도움을 주셔서 항상 감사합니다. 다음 수식 중 매수/매도 부분에 관해서 문의를 드립니다. 1. 매수 - 일봉 거래 시 동시호가 매수가 불가하므로, 다음과 같은 형태로 작성하면 15시 15분에 매수 진입 가능할까요? if Time >= 151500 Then { buy("매수1", OnClose,C,Floor(금액1/C)); } 2. 매도 - 매수 가격 대비 10% 상승 시 매도하고 싶은데 매수일 익일에는 원하는 가격에 도달해도 매도가 안되는데 이유를 모르겠습니다.(+2영업일 이상에서는 제대로 매도가 됩니다) (예, SG세계물산 2019.06.19 종가 매수(1,240) 후 2019.09.20 고가 1,380으로 10% 이상 상승했으나 매도안됨) 감사드립니다. 즐거운 주말 보내세요. --------------------------------------------------------------------------- Input : 금액1(10000000); var : ma3(0), ma4(0), ma5(0), wma10(0), B_index(0), B_v(0), B_price1(0), B_price2(0), B_price3(0), HH(0),HC(0), CC(0),S_index(0),B_seled(false), Diff(false), 매수가능1(False); var : Price_high_120(0), Volume_high_120(0),Price_low_120(0); Price_high_120 = highest(h,120); If highest(h,120)>highest(h[1],120) Then { Price_low_120 = lowest(L,120); } ma3 = ma(c,3); ma4 = ma(c,4); ma5 = ma(c,5); wma10 = wma(c,10); if C >= O*(1+0.15) and M >=50000000000 and H >= Highest(H,60) and Price_high_120 < Price_low_120 * 5 then { B_seled = true; //기준봉 선정 여부 B_index = index; //기준봉 index B_v = V; HH = H; HC = C; CC = C; } If B_seled == true Then { if H > HH Then HH = H; if C > HC then HC = C; } if marketposition == 0 and B_seled == true and (index > B_index and index <= B_index + 15) and v<B_v*0.3 and c<=wma10 Then { if HH < Price_low_120* 4 and HC < CC*1.2 Then { if C<O and C<wMa10 and (S_index == 0 or (S_index>0 and index > S_index + 60)) then { if Time >= 151500 Then { buy("매수1", OnClose,C,Floor(금액1/C)); } } } } If CurrentEntries == 1 Then { B_price1 = latestentryprice(0); } if marketposition == 1 Then { If LatestEntryName(0) == "매수1" Then { exitlong("매도1", AtLimit, B_price1 * 1.1); } ExitLong("손절", AtStop, AvgEntryPrice*0.75); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-08-20 13:21:56

안녕하세요 예스스탁입니다. 1 plot1(time); 시간은 사용자분이 적용하시는 차트에서 time값으로 151500이후 첫봉을 확인하시고 지정하셔야 합니다. 위 지표 적용해서 시간 확인하시기 바랍니다. 참고로 시간이 조건으로 들어가는 모든 식은 분봉이하 주기에 적용하셔야 합니다. 일봉이상은 if문이 봉완성시이므로 시간으로 조건을 지정하는 것이 의미가 없습니다. 일봉에 적용하는 식이면 시간조건을 제외하셔야 하고 봉완성이 다음봉시가수신이므로 매수신호는 일봉에서 신호가 발생하면 다음날 시가에 주문이 집행됩니다. 2 일봉에 적용하는 식이시면 식 내용을 변경해야 합니다. 매수의 time조건도 삭제해 드립니다. Input : 금액1(10000000); var : ma3(0), ma4(0), ma5(0), wma10(0), B_index(0), B_v(0), B_price1(0), B_price2(0), B_price3(0), HH(0),HC(0), CC(0),S_index(0),B_seled(false), Diff(false), 매수가능1(False); var : Price_high_120(0), Volume_high_120(0),Price_low_120(0); Price_high_120 = highest(h,120); If highest(h,120)>highest(h[1],120) Then { Price_low_120 = lowest(L,120); } ma3 = ma(c,3); ma4 = ma(c,4); ma5 = ma(c,5); wma10 = wma(c,10); if C >= O*(1+0.15) and M >=50000000000 and H >= Highest(H,60) and Price_high_120 < Price_low_120 * 5 then { B_seled = true; //기준봉 선정 여부 B_index = index; //기준봉 index B_v = V; HH = H; HC = C; CC = C; } If B_seled == true Then { if H > HH Then HH = H; if C > HC then HC = C; } if marketposition == 0 and B_seled == true and (index > B_index and index <= B_index + 15) and v<B_v*0.3 and c<=wma10 Then { if HH < Price_low_120* 4 and HC < CC*1.2 Then { if C<O and C<wMa10 and (S_index == 0 or (S_index>0 and index > S_index + 60)) then { buy("매수1", OnClose,C,Floor(금액1/C)); exitlong("매도", AtLimit, C * 1.1); exitlong("손절", AtLimit, C * 0.75); } } } If CurrentEntries == 1 Then { B_price1 = latestentryprice(0); } if marketposition == 1 Then { If LatestEntryName(0) == "매수1" Then { exitlong("매도1", AtLimit, B_price1 * 1.1); } ExitLong("손절1", AtStop, AvgEntryPrice*0.75); } 즐거운 하루되세요 > 깜피 님이 쓴 글입니다. > 제목 : 문의드립니다. > 안녕하세요. 시스템 개발에 많은 도움을 주셔서 항상 감사합니다. 다음 수식 중 매수/매도 부분에 관해서 문의를 드립니다. 1. 매수 - 일봉 거래 시 동시호가 매수가 불가하므로, 다음과 같은 형태로 작성하면 15시 15분에 매수 진입 가능할까요? if Time >= 151500 Then { buy("매수1", OnClose,C,Floor(금액1/C)); } 2. 매도 - 매수 가격 대비 10% 상승 시 매도하고 싶은데 매수일 익일에는 원하는 가격에 도달해도 매도가 안되는데 이유를 모르겠습니다.(+2영업일 이상에서는 제대로 매도가 됩니다) (예, SG세계물산 2019.06.19 종가 매수(1,240) 후 2019.09.20 고가 1,380으로 10% 이상 상승했으나 매도안됨) 감사드립니다. 즐거운 주말 보내세요. --------------------------------------------------------------------------- Input : 금액1(10000000); var : ma3(0), ma4(0), ma5(0), wma10(0), B_index(0), B_v(0), B_price1(0), B_price2(0), B_price3(0), HH(0),HC(0), CC(0),S_index(0),B_seled(false), Diff(false), 매수가능1(False); var : Price_high_120(0), Volume_high_120(0),Price_low_120(0); Price_high_120 = highest(h,120); If highest(h,120)>highest(h[1],120) Then { Price_low_120 = lowest(L,120); } ma3 = ma(c,3); ma4 = ma(c,4); ma5 = ma(c,5); wma10 = wma(c,10); if C >= O*(1+0.15) and M >=50000000000 and H >= Highest(H,60) and Price_high_120 < Price_low_120 * 5 then { B_seled = true; //기준봉 선정 여부 B_index = index; //기준봉 index B_v = V; HH = H; HC = C; CC = C; } If B_seled == true Then { if H > HH Then HH = H; if C > HC then HC = C; } if marketposition == 0 and B_seled == true and (index > B_index and index <= B_index + 15) and v<B_v*0.3 and c<=wma10 Then { if HH < Price_low_120* 4 and HC < CC*1.2 Then { if C<O and C<wMa10 and (S_index == 0 or (S_index>0 and index > S_index + 60)) then { if Time >= 151500 Then { buy("매수1", OnClose,C,Floor(금액1/C)); } } } } If CurrentEntries == 1 Then { B_price1 = latestentryprice(0); } if marketposition == 1 Then { If LatestEntryName(0) == "매수1" Then { exitlong("매도1", AtLimit, B_price1 * 1.1); } ExitLong("손절", AtStop, AvgEntryPrice*0.75); }