커뮤니티

문의 드립니다.

프로필 이미지
jesten77
2021-11-15 21:57:40
581
글번호 153624
답변완료
항상 감사드립니다. 주신 수식에 조언 주신대로 시간 조정하고 거래횟수를 추가해서 데모를 해보았습니다. 거래횟수 제한 수식을 잘못 넣었는지 시간내내 계속 거래가 되었습니다. 수정 부탁드립니다. 아래 내용 조금 헷갈려서요. 아래 수식 주석 부탁드립니다. 그리고 BX. CX 부분을 신호나온 이전캔들 N개의 최고가, 최저가 돌파시 하는 수식도 부탁드립니다. 감사합니다. input : n1(5); input : StartTime(231000),EndTime(053000); input : 익절틱수(80),손절틱수(0), 거래횟수(N); var : Tcond(false), T(0), entry(0); Array : H1[50](0),L1[50](0); 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; { T = 0; Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true and entry < 거래횟수 Then { if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) Then Buy("b1",AtStop,Highest(H,n1)+PriceScale*1); if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) Then Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } }
시스템
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2021-11-16 15:13:40

안녕하세요 예스스탁입니다. if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; { T = 0; Tcond = true; entry = 0; } 수식에 위와 같이 잘못작성된 내용이 있어 수정해 드립니다. {}안의 내용이 if문과 별도로 취급되어 매봉 초기화가 됩니다. 이전문의와 같이 지정한 진입횟수 도달 후 bx,sx청산이 작동되지 않아 수정하고 내용을 진입신호봉기준 이전 n개봉 최고가와 최저가로 수정해 드립니다. input : n1(5),n(10); input : StartTime(231000),EndTime(053000); input : 익절틱수(80),손절틱수(0), 거래횟수(10); var : Tcond(false), T(0), entry(0); 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 { T = 0; Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true Then { if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) and entry < 거래횟수 Then Buy("b1",AtStop,Highest(H,n1)+PriceScale*1); if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) and entry < 거래횟수 Then Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,Lowest(L,n)[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,Highest(H,n)[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } } 즐거운 하루되세요 > jesten77 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 항상 감사드립니다. 주신 수식에 조언 주신대로 시간 조정하고 거래횟수를 추가해서 데모를 해보았습니다. 거래횟수 제한 수식을 잘못 넣었는지 시간내내 계속 거래가 되었습니다. 수정 부탁드립니다. 아래 내용 조금 헷갈려서요. 아래 수식 주석 부탁드립니다. 그리고 BX. CX 부분을 신호나온 이전캔들 N개의 최고가, 최저가 돌파시 하는 수식도 부탁드립니다. 감사합니다. input : n1(5); input : StartTime(231000),EndTime(053000); input : 익절틱수(80),손절틱수(0), 거래횟수(N); var : Tcond(false), T(0), entry(0); Array : H1[50](0),L1[50](0); 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; { T = 0; Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true and entry < 거래횟수 Then { if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) Then Buy("b1",AtStop,Highest(H,n1)+PriceScale*1); if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) Then Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } }
프로필 이미지

jesten77

2021-11-16 16:19:50

궁금해서 질문 드립니다. 수식에서 n(10)이 어떤 의미인지요? 이전캔들의 10개의 최고가 최저가에 BX, CX 적용하기 위한 건가요? > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; { T = 0; Tcond = true; entry = 0; } 수식에 위와 같이 잘못작성된 내용이 있어 수정해 드립니다. {}안의 내용이 if문과 별도로 취급되어 매봉 초기화가 됩니다. 이전문의와 같이 지정한 진입횟수 도달 후 bx,sx청산이 작동되지 않아 수정하고 내용을 진입신호봉기준 이전 n개봉 최고가와 최저가로 수정해 드립니다. input : n1(5),n(10); input : StartTime(231000),EndTime(053000); input : 익절틱수(80),손절틱수(0), 거래횟수(10); var : Tcond(false), T(0), entry(0); 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 { T = 0; Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true Then { if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) and entry < 거래횟수 Then Buy("b1",AtStop,Highest(H,n1)+PriceScale*1); if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) and entry < 거래횟수 Then Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,Lowest(L,n)[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,Highest(H,n)[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } } 즐거운 하루되세요 > jesten77 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 항상 감사드립니다. 주신 수식에 조언 주신대로 시간 조정하고 거래횟수를 추가해서 데모를 해보았습니다. 거래횟수 제한 수식을 잘못 넣었는지 시간내내 계속 거래가 되었습니다. 수정 부탁드립니다. 아래 내용 조금 헷갈려서요. 아래 수식 주석 부탁드립니다. 그리고 BX. CX 부분을 신호나온 이전캔들 N개의 최고가, 최저가 돌파시 하는 수식도 부탁드립니다. 감사합니다. input : n1(5); input : StartTime(231000),EndTime(053000); input : 익절틱수(80),손절틱수(0), 거래횟수(N); var : Tcond(false), T(0), entry(0); Array : H1[50](0),L1[50](0); 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; { T = 0; Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true and entry < 거래횟수 Then { if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) Then Buy("b1",AtStop,Highest(H,n1)+PriceScale*1); if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) Then Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } }
프로필 이미지

예스스탁 예스스탁 답변

2021-11-16 16:26:40

안녕하세요 예스스탁입니다. 진입봉기준 이전 n개봉 최고가와 최저가입니다. bx,sx청산에 사용됩니다. 즐거운 하루되세요 > jesten77 님이 쓴 글입니다. > 제목 : Re : Re : 문의 드립니다. > 궁금해서 질문 드립니다. 수식에서 n(10)이 어떤 의미인지요? 이전캔들의 10개의 최고가 최저가에 BX, CX 적용하기 위한 건가요? > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; { T = 0; Tcond = true; entry = 0; } 수식에 위와 같이 잘못작성된 내용이 있어 수정해 드립니다. {}안의 내용이 if문과 별도로 취급되어 매봉 초기화가 됩니다. 이전문의와 같이 지정한 진입횟수 도달 후 bx,sx청산이 작동되지 않아 수정하고 내용을 진입신호봉기준 이전 n개봉 최고가와 최저가로 수정해 드립니다. input : n1(5),n(10); input : StartTime(231000),EndTime(053000); input : 익절틱수(80),손절틱수(0), 거래횟수(10); var : Tcond(false), T(0), entry(0); 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 { T = 0; Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true Then { if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) and entry < 거래횟수 Then Buy("b1",AtStop,Highest(H,n1)+PriceScale*1); if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) and entry < 거래횟수 Then Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,Lowest(L,n)[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,Highest(H,n)[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } } 즐거운 하루되세요 > jesten77 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 항상 감사드립니다. 주신 수식에 조언 주신대로 시간 조정하고 거래횟수를 추가해서 데모를 해보았습니다. 거래횟수 제한 수식을 잘못 넣었는지 시간내내 계속 거래가 되었습니다. 수정 부탁드립니다. 아래 내용 조금 헷갈려서요. 아래 수식 주석 부탁드립니다. 그리고 BX. CX 부분을 신호나온 이전캔들 N개의 최고가, 최저가 돌파시 하는 수식도 부탁드립니다. 감사합니다. input : n1(5); input : StartTime(231000),EndTime(053000); input : 익절틱수(80),손절틱수(0), 거래횟수(N); var : Tcond(false), T(0), entry(0); Array : H1[50](0),L1[50](0); 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; { T = 0; Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true and entry < 거래횟수 Then { if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) Then Buy("b1",AtStop,Highest(H,n1)+PriceScale*1); if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) Then Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } }