커뮤니티

수식확인 요청

프로필 이미지
바나
2021-04-12 21:37:32
621
글번호 147949
답변완료
수식을 수정해 주셨는데, 신호가 전혀 잡히지 않아, 첫번째 매수에 있는 LatestEntryPrice(0)*0.98 식을 삭제하고 했더니 매수가 잡히긴 했으나, 두번째 매수부터는 전혀 진행되지 않았습니다... 그리고 매도는 RSI 80이상일시 50프로 매도후에, 나머지는 파라볼릭 sar 매도점이 나오면 바로 올매도 하는식으로 바꾸고 싶습니다. Input : 투자금액(10000000),RSIP(14), P1(5), P2(25), P3(100), 시작일(20210407),시작시간(073000); var : value(0),e(0),x(0),count(0),Vma(0), Tcond(false); var : Rsiv(0),vv(0), Entry(0), mav1(0); var1 = ma(C,p1); var2 = ma(C,p2); var3 = ma(C,p3); var4 = sar(0.02,0.2); mav1 = ma(C,30); Rsiv = RSI(RSIP); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { if crossup(c,var4) Then Entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition == 0 and Entry < 1 and var1 > var2 and Rsiv < 60 and C > var4 Then buy("b1",OnClose,DEF,Floor((투자금액*0.1)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 0 and MaxEntries == 1 Then buy("b2",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.1)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 0 and MaxEntries == 2 Then buy("b3",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.2)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 0 and MaxEntries == 3 Then buy("b4",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.2)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 0 and MaxEntries == 4 Then buy("b5",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.4)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 1 and Rsiv > 55 and var1 > var2 and var2 > var3 and C < var4 Then exitlong("s"); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-04-13 13:48:43

안녕하세요 예스스탁입니다. 진입식을 수정했습니다. 청산의 경우 일부청산의 경우 횟수지정이 모호합니다. 진입후에 1회로 지정해 드립니다. 그러므로 진입후 일부청산이 발생하고 다시 추가진입이 발생하면 다시 1번더 발생할 수 있습니다. Input : 투자금액(10000000),RSIP(14), P1(5), P2(25), P3(100), 시작일(20210407),시작시간(073000); var : value(0),e(0),x(0),count(0),Vma(0), Tcond(false); var : Rsiv(0),vv(0), Entry(0), mav1(0); var1 = ma(C,p1); var2 = ma(C,p2); var3 = ma(C,p3); var4 = sar(0.02,0.2); mav1 = ma(C,30); Rsiv = RSI(RSIP); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { if crossup(c,var4) Then Entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition == 0 and Entry < 1 and var1 > var2 and Rsiv < 60 and C > var4 Then buy("b1",OnClose,DEF,Floor((투자금액*0.1)/c)); if MarketPosition == 1 and MaxEntries == 1 Then buy("b2",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.1)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 1 and MaxEntries == 2 Then buy("b3",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.2)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 1 and MaxEntries == 3 Then buy("b4",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.2)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 1 and MaxEntries == 4 Then buy("b5",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.4)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then Condition1 = true; if LatestExitName(0) == "bx1" Then Condition1 = False; if Condition1 == true and crossup(RSIV,80) Then exitlong("bx1",OnClose,DEf,"",Floor(CurrentContracts*0.5),1); if crossup(c,Var4) Then exitlong("bx2"); } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : 수식확인 요청 > 수식을 수정해 주셨는데, 신호가 전혀 잡히지 않아, 첫번째 매수에 있는 LatestEntryPrice(0)*0.98 식을 삭제하고 했더니 매수가 잡히긴 했으나, 두번째 매수부터는 전혀 진행되지 않았습니다... 그리고 매도는 RSI 80이상일시 50프로 매도후에, 나머지는 파라볼릭 sar 매도점이 나오면 바로 올매도 하는식으로 바꾸고 싶습니다. Input : 투자금액(10000000),RSIP(14), P1(5), P2(25), P3(100), 시작일(20210407),시작시간(073000); var : value(0),e(0),x(0),count(0),Vma(0), Tcond(false); var : Rsiv(0),vv(0), Entry(0), mav1(0); var1 = ma(C,p1); var2 = ma(C,p2); var3 = ma(C,p3); var4 = sar(0.02,0.2); mav1 = ma(C,30); Rsiv = RSI(RSIP); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { if crossup(c,var4) Then Entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition == 0 and Entry < 1 and var1 > var2 and Rsiv < 60 and C > var4 Then buy("b1",OnClose,DEF,Floor((투자금액*0.1)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 0 and MaxEntries == 1 Then buy("b2",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.1)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 0 and MaxEntries == 2 Then buy("b3",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.2)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 0 and MaxEntries == 3 Then buy("b4",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.2)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 0 and MaxEntries == 4 Then buy("b5",atlimit,LatestEntryPrice(0)*0.98,Floor((투자금액*0.4)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); if MarketPosition == 1 and Rsiv > 55 and var1 > var2 and var2 > var3 and C < var4 Then exitlong("s"); }