커뮤니티

진입후 일정부문 하락(상승)시 추가 진입 을 총 2회까지 할려는 수식이...잘 안되네요

프로필 이미지
이형지
2018-10-17 21:10:31
124
글번호 122767
답변완료
진입후 P7 / P8 만큼 하락시 추가 진입하는 수식이구요.. 이수식은 잘 구현되는데 추가로 더 하락시 3차까지 진입하는 수식이 잘안되네요.... If MarketPosition == 0 and C >= (dayopen+value1*mav3) and Condition1 == false Then { Buy("매수"); } if MaxEntries == 1 and MarketPosition == 1 Then { buy("추가매수",atlimit,EntryPrice-P7); } If MarketPosition == 0 and C <= (dayopen-value1*mav2) and Condition1 == false Then { sell("매도"); } if MaxEntries == 1 and MarketPosition == -1 Then { Sell("추가매도",atlimit,EntryPrice+P8); } } ============================================================================== 오류발생 If MarketPosition == 0 and C >= (dayopen+value1*mav3) and Condition1 == false Then { Buy("매수"); } if MaxEntries == 1 and MarketPosition == 1 Then { buy("추가매수",atlimit,EntryPrice-P7); } if MaxEntries == 2 and MarketPosition == 1 Then { buy("추가매수",atlimit,EntryPrice-P9); } If MarketPosition == 0 and C <= (dayopen-value1*mav2) and Condition1 == false Then { sell("매도"); } if MaxEntries == 1 and MarketPosition == -1 Then { Sell("추가매도",atlimit,EntryPrice+P8); } if MaxEntries == 2 and MarketPosition == -1 Then { Sell("추가매도",atlimit,EntryPrice+P10); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-10-18 13:43:38

안녕하세요 예스스탁입니다. 수식에 특별한 오류내용은 없습니다. 함수별로 지정한 이름은 달라야 하므로 이름만 다르게 지정해 주시면 됩니다. If MarketPosition == 0 and C >= (dayopen+value1*mav3) and Condition1 == false Then { Buy("매수"); } if MaxEntries == 1 and MarketPosition == 1 Then { buy("추가매수1",atlimit,EntryPrice-P7); } if MaxEntries == 2 and MarketPosition == 1 Then { buy("추가매수2",atlimit,EntryPrice-P9); } If MarketPosition == 0 and C <= (dayopen-value1*mav2) and Condition1 == false Then { sell("매도"); } if MaxEntries == 1 and MarketPosition == -1 Then { Sell("추가매도1",atlimit,EntryPrice+P8); } if MaxEntries == 2 and MarketPosition == -1 Then { Sell("추가매도2",atlimit,EntryPrice+P10); } 즐거운 하루되세요 > 이형지 님이 쓴 글입니다. > 제목 : 진입후 일정부문 하락(상승)시 추가 진입 을 총 2회까지 할려는 수식이...잘 안되네요 > 진입후 P7 / P8 만큼 하락시 추가 진입하는 수식이구요.. 이수식은 잘 구현되는데 추가로 더 하락시 3차까지 진입하는 수식이 잘안되네요.... If MarketPosition == 0 and C >= (dayopen+value1*mav3) and Condition1 == false Then { Buy("매수"); } if MaxEntries == 1 and MarketPosition == 1 Then { buy("추가매수",atlimit,EntryPrice-P7); } If MarketPosition == 0 and C <= (dayopen-value1*mav2) and Condition1 == false Then { sell("매도"); } if MaxEntries == 1 and MarketPosition == -1 Then { Sell("추가매도",atlimit,EntryPrice+P8); } } ============================================================================== 오류발생 If MarketPosition == 0 and C >= (dayopen+value1*mav3) and Condition1 == false Then { Buy("매수"); } if MaxEntries == 1 and MarketPosition == 1 Then { buy("추가매수",atlimit,EntryPrice-P7); } if MaxEntries == 2 and MarketPosition == 1 Then { buy("추가매수",atlimit,EntryPrice-P9); } If MarketPosition == 0 and C <= (dayopen-value1*mav2) and Condition1 == false Then { sell("매도"); } if MaxEntries == 1 and MarketPosition == -1 Then { Sell("추가매도",atlimit,EntryPrice+P8); } if MaxEntries == 2 and MarketPosition == -1 Then { Sell("추가매도",atlimit,EntryPrice+P10); } }