커뮤니티

수식수정 부탁드립니다.

프로필 이미지
고박사122
2024-06-26 10:15:02
1042
글번호 180969
답변완료
안녕하세요. 더위가 찾아오는 요즈음 무탈하시길 빕니다. 이번에 요청드릴 사항은 다음 수식을 수정하여 진입조건이 "ADX 값이 var1 >= 25 이면서 또한 ADX 값이 상승추세"일때 진입하며, 일목균형표 상 양의 구름대일때는 매수진입만, 음의 구름대일때는 매도만 진입되도록 부탁드립니다. input : 거래시간 (1), 시작시간 (160000), 끝시간 (045500),익절틱수 (36),손절틱수 (15); input : ADXP(9),CCIP1(50),CCIP2(14); Var: HH(0), LL(0), HHH(0), LLL(0), FK(0), Condition3(false); if 거래시간 == 1 then condition3 = (stime>=시작시간 or stime<=끝시간 ); Else if 거래시간 == 2 then condition3 = (stime>=시작시간 and stime<=끝시간 ); Else condition3 = true; var1 = adx(ADXP); var2 = cci(CCIP1); var3 = cci(CCIP2); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 >= 25 and (CrossUp(var2,100)) and var3 > 0 Then buy(); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 >= 25 and (CrossDown(var2,-100)) and var3 < 0 Then sell(); if MarketPosition == 1 Then{ LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 )); ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL); } if MarketPosition == -1 Then{ HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 )); ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH); } SetStopProfittarget(PriceScale*익절틱수,PointStop); if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } #매수진입가격은 신호봉 저가-1틱 if MarketPosition == 1 and CurrentContracts > CurrentContracts[1] Then Text_New(EntryDate,EntryTime,L[BarsSinceEntry]-PriceScale*3,NumToStr(EntryPrice,2)); #매도진입가격은 신호봉 고가+1틱 if MarketPosition == -1 and CurrentContracts > CurrentContracts[1] Then Text_New(EntryDate,EntryTime,H[BarsSinceEntry]+PriceScale*3,NumToStr(EntryPrice,2)); #매수청산가격은 신호봉 고가+1틱 if TotalTrades > TotalTrades[1] and MarketPosition(1) == 1 Then Text_New(ExitDate(1),Exittime(1),H[BarsSinceExit(1)]+PriceScale*3,NumToStr(ExitPrice(1),2)); #매도청산가격은 신호봉 저가-1틱 if TotalTrades > TotalTrades[1] and MarketPosition(1) == -1 Then Text_New(ExitDate(1),Exittime(1),L[BarsSinceExit(1)]-PriceScale*3,NumToStr(ExitPrice(1),2));
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-06-26 14:14:52

안녕하세요 예스스탁입니다. input : 거래시간 (1), 시작시간 (160000), 끝시간 (045500),익절틱수 (36),손절틱수 (15); input : ADXP(9),CCIP1(50),CCIP2(14); Var: HH(0), LL(0), HHH(0), LLL(0), FK(0), Condition3(false); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); if 거래시간 == 1 then condition3 = (stime>=시작시간 or stime<=끝시간 ); Else if 거래시간 == 2 then condition3 = (stime>=시작시간 and stime<=끝시간 ); Else condition3 = true; var1 = adx(ADXP); var2 = cci(CCIP1); var3 = cci(CCIP2); 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 >= 25 and var1 > var1[1] and #ADX 값이25 이상이면서 ADX 상승추세 선행스팬1 > 선행스팬2 and #양운 (CrossUp(var2,100)) and var3 > 0 Then buy(); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 >= 25 and var1 > var1[1] and #ADX 값이25 이상이면서 ADX 상승추세 선행스팬1 < 선행스팬2 and #음운 (CrossDown(var2,-100)) and var3 < 0 Then sell(); if MarketPosition == 1 Then{ LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 )); ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL); } if MarketPosition == -1 Then{ HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 )); ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH); } SetStopProfittarget(PriceScale*익절틱수,PointStop); if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } #매수진입가격은 신호봉 저가-1틱 if MarketPosition == 1 and CurrentContracts > CurrentContracts[1] Then Text_New(EntryDate,EntryTime,L[BarsSinceEntry]-PriceScale*3,NumToStr(EntryPrice,2)); #매도진입가격은 신호봉 고가+1틱 if MarketPosition == -1 and CurrentContracts > CurrentContracts[1] Then Text_New(EntryDate,EntryTime,H[BarsSinceEntry]+PriceScale*3,NumToStr(EntryPrice,2)); #매수청산가격은 신호봉 고가+1틱 if TotalTrades > TotalTrades[1] and MarketPosition(1) == 1 Then Text_New(ExitDate(1),Exittime(1),H[BarsSinceExit(1)]+PriceScale*3,NumToStr(ExitPrice(1),2)); #매도청산가격은 신호봉 저가-1틱 if TotalTrades > TotalTrades[1] and MarketPosition(1) == -1 Then Text_New(ExitDate(1),Exittime(1),L[BarsSinceExit(1)]-PriceScale*3,NumToStr(ExitPrice(1),2)); 즐거운 하루되세요 > 고박사122 님이 쓴 글입니다. > 제목 : 수식수정 부탁드립니다. > 안녕하세요. 더위가 찾아오는 요즈음 무탈하시길 빕니다. 이번에 요청드릴 사항은 다음 수식을 수정하여 진입조건이 "ADX 값이 var1 >= 25 이면서 또한 ADX 값이 상승추세"일때 진입하며, 일목균형표 상 양의 구름대일때는 매수진입만, 음의 구름대일때는 매도만 진입되도록 부탁드립니다. input : 거래시간 (1), 시작시간 (160000), 끝시간 (045500),익절틱수 (36),손절틱수 (15); input : ADXP(9),CCIP1(50),CCIP2(14); Var: HH(0), LL(0), HHH(0), LLL(0), FK(0), Condition3(false); if 거래시간 == 1 then condition3 = (stime>=시작시간 or stime<=끝시간 ); Else if 거래시간 == 2 then condition3 = (stime>=시작시간 and stime<=끝시간 ); Else condition3 = true; var1 = adx(ADXP); var2 = cci(CCIP1); var3 = cci(CCIP2); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 >= 25 and (CrossUp(var2,100)) and var3 > 0 Then buy(); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 >= 25 and (CrossDown(var2,-100)) and var3 < 0 Then sell(); if MarketPosition == 1 Then{ LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 )); ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL); } if MarketPosition == -1 Then{ HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 )); ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH); } SetStopProfittarget(PriceScale*익절틱수,PointStop); if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } #매수진입가격은 신호봉 저가-1틱 if MarketPosition == 1 and CurrentContracts > CurrentContracts[1] Then Text_New(EntryDate,EntryTime,L[BarsSinceEntry]-PriceScale*3,NumToStr(EntryPrice,2)); #매도진입가격은 신호봉 고가+1틱 if MarketPosition == -1 and CurrentContracts > CurrentContracts[1] Then Text_New(EntryDate,EntryTime,H[BarsSinceEntry]+PriceScale*3,NumToStr(EntryPrice,2)); #매수청산가격은 신호봉 고가+1틱 if TotalTrades > TotalTrades[1] and MarketPosition(1) == 1 Then Text_New(ExitDate(1),Exittime(1),H[BarsSinceExit(1)]+PriceScale*3,NumToStr(ExitPrice(1),2)); #매도청산가격은 신호봉 저가-1틱 if TotalTrades > TotalTrades[1] and MarketPosition(1) == -1 Then Text_New(ExitDate(1),Exittime(1),L[BarsSinceExit(1)]-PriceScale*3,NumToStr(ExitPrice(1),2));