커뮤니티

시스템식 여쭤봅니다~

프로필 이미지
부자청년28
2019-09-22 13:50:30
143
글번호 132141
답변완료
1. 매수금액과 최근일봉개수를 변수로 지정하고 싶습니다. 당일 전체 매도가 일어나 물량이 정리되면 당일 재매수 금지 매수시간은 오전9시 부터 오전11시 까지 당일 청산 매도는 15시20분 2. 일봉에다가 적용해도 작동하는건지 아니면 1분봉 정도에 적용하면될지요? 매수조건 오늘 일봉상 시가갭 1% 이상 발생 and 오늘 일봉상 시가는 1일전부터 최근 일봉 3봉 종가중 최고가 and 시가갭상승후 가격이 하락하여 최근 일봉 3봉의 종가중에 가장높은 가격의 종가에 +1% 까지 하락하여 근접시 바로 매수금액의 35% 1차 매수 가장높은 종가와 같은 가격 터치시 바로 35% 2차 매수 가장높은 종가에서 -1% 하락시 바로 나머지 3차 매수 매도 조건 매수후 수익률이 4% 상승시 전체물량의 50% 매도 수익률이 8% 상승시 남은물량의 50% 매도 수익률이 12% 상승시 전체 매도 수익률이 4% 까지 상승후 다시 주가가 하락하여 1%까지 떨어지면 전부 매도 수익률이 8% 까지 상승후 다시 주가가 하락하여 5%까지 떨어지면 전부 매도 손절은 매수가에서 -3% 시에 50% 시장가 매도 -5% 시에 전부 시장가 매도 ================================================================================= 1차 매수가 2차 매수가 3차 매수가 를 직접 금액으로 1000(원) 이런식으로 설정하는 수식도 따로 알고 싶습니다. 감사합니다~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-09-24 11:09:00

안녕하세요 예스스탁입니다. 수식에 시간조건과 당일청산이 들어가면 분봉이하에 적용하셔야 합니다. 일봉은 시간조건을 지정할수 없습니다. 1 input : 매수금액(10000000); input : starttime(90000),endtime(120000); var : Tcond(false); if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if DayOpen > DayClose(1)*1.01 and dayopen > max(DayClose(1),DayClose(2),DayClose(3)) and Tcond == true Then { if MarketPosition == 0 Then buy("b1",atlimit, max(DayClose(1),DayClose(2),DayClose(3))*1.01,Floor((매수금액*0.35)/c)); if MarketPosition == 1 and MaxEntries == 1 Then buy("b2",atlimit, max(DayClose(1),DayClose(2),DayClose(3)),Floor((매수금액*0.35)/c)); if MarketPosition == 1 and MaxEntries == 2 Then buy("b3",atlimit, max(DayClose(1),DayClose(2),DayClose(3))*0.99,Floor((매수금액*0.30)/c)); } if MarketPosition == 1 then { if LatestExitName(0) == "bp1" Then Condition1 = true; if LatestExitName(0) == "bp2" Then Condition1 = true; if LatestExitName(0) == "bl11" Then Condition3 = true; if Condition1 == true Then ExitLong("bp1",atlimit,AvgEntryPrice*1.04,"",Floor(CurrentContracts*0.5),1); if Condition2 == true Then ExitLong("bp2",atlimit,AvgEntryPrice*1.08,"",Floor(CurrentContracts*0.5),1); ExitLong("bp3",atlimit,AvgEntryPrice*1.12); if Condition3 == true then ExitLong("bl1",AtStop,AvgEntryPrice*0.97,"",Floor(CurrentContracts*0.5),1); ExitLong("bl2",AtStop,AvgEntryPrice*0.95); if Condition1 == true Then ExitLong("tr1",AtStop,AvgEntryPrice*1.01); if Condition2 == true Then ExitLong("tr2",AtStop,AvgEntryPrice*1.05); } else { Condition1 = false; Condition2 = false; Condition3 = false; } SetStopEndofday(152000); 2 input : 매수금액(10000000),매수가1(1000),매수가2(900),매수가3(800); input : starttime(90000),endtime(120000); var : Tcond(false); if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if MarketPosition == 0 and L > 매수가1 Then buy("b1",atlimit, 매수가1,Floor((매수금액*0.35)/c)); if MarketPosition == 1 and MaxEntries == 1 and L > 매수가2 Then buy("b2",atlimit, 매수가2,Floor((매수금액*0.35)/c)); if MarketPosition == 1 and MaxEntries == 2 and L > 매수가3 Then buy("b3",atlimit,매수가3,Floor((매수금액*0.30)/c)); if MarketPosition == 1 then { if LatestExitName(0) == "bp1" Then Condition1 = true; if LatestExitName(0) == "bp2" Then Condition1 = true; if LatestExitName(0) == "bl11" Then Condition3 = true; if Condition1 == true Then ExitLong("bp1",atlimit,AvgEntryPrice*1.04,"",Floor(CurrentContracts*0.5),1); if Condition2 == true Then ExitLong("bp2",atlimit,AvgEntryPrice*1.08,"",Floor(CurrentContracts*0.5),1); ExitLong("bp3",atlimit,AvgEntryPrice*1.12); if Condition3 == true then ExitLong("bl1",AtStop,AvgEntryPrice*0.97,"",Floor(CurrentContracts*0.5),1); ExitLong("bl2",AtStop,AvgEntryPrice*0.95); if Condition1 == true Then ExitLong("tr1",AtStop,AvgEntryPrice*1.01); if Condition2 == true Then ExitLong("tr2",AtStop,AvgEntryPrice*1.05); } else { Condition1 = false; Condition2 = false; Condition3 = false; } SetStopEndofday(152000); 즐거운 하루되세요 > 부자청년28 님이 쓴 글입니다. > 제목 : 시스템식 여쭤봅니다~ > 1. 매수금액과 최근일봉개수를 변수로 지정하고 싶습니다. 당일 전체 매도가 일어나 물량이 정리되면 당일 재매수 금지 매수시간은 오전9시 부터 오전11시 까지 당일 청산 매도는 15시20분 2. 일봉에다가 적용해도 작동하는건지 아니면 1분봉 정도에 적용하면될지요? 매수조건 오늘 일봉상 시가갭 1% 이상 발생 and 오늘 일봉상 시가는 1일전부터 최근 일봉 3봉 종가중 최고가 and 시가갭상승후 가격이 하락하여 최근 일봉 3봉의 종가중에 가장높은 가격의 종가에 +1% 까지 하락하여 근접시 바로 매수금액의 35% 1차 매수 가장높은 종가와 같은 가격 터치시 바로 35% 2차 매수 가장높은 종가에서 -1% 하락시 바로 나머지 3차 매수 매도 조건 매수후 수익률이 4% 상승시 전체물량의 50% 매도 수익률이 8% 상승시 남은물량의 50% 매도 수익률이 12% 상승시 전체 매도 수익률이 4% 까지 상승후 다시 주가가 하락하여 1%까지 떨어지면 전부 매도 수익률이 8% 까지 상승후 다시 주가가 하락하여 5%까지 떨어지면 전부 매도 손절은 매수가에서 -3% 시에 50% 시장가 매도 -5% 시에 전부 시장가 매도 ================================================================================= 1차 매수가 2차 매수가 3차 매수가 를 직접 금액으로 1000(원) 이런식으로 설정하는 수식도 따로 알고 싶습니다. 감사합니다~