커뮤니티

문의드립니다,

프로필 이미지
2685up
2025-06-16 11:24:15
135
글번호 191756
답변완료
수고하십니다. 아래수식을 data2를 macd말고 이동평균선으로 변경부탁드립니다. input : short1(12),long1(26),sig1(9); input : short2(12),long2(26),sig2(9); input : Per(30); var : MACDO1(0,Data1),MACDO2(0,Data2); MACDO1 = Data1(MACD_OSC(short1,long1,sig1)); MACDO2 = Data2(MACD_OSC(short2,long2,sig2)); if MarketPosition == 0 and Data2(CrossUp(MACDO2,0)) Then Buy(); if MarketPosition == 1 Then { if data1(CrossDown(MACDO1,0)) Then ExitLong("bx1",OnClose,Def,"",Ceiling(MaxContracts*(Per/100)/10)*10,2); if data2(CrossDown(MACDO2,0)) Then ExitLong("bx2"); } 감사합니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-06-16 15:38:01

안녕하세요 예스스탁입니다. input : short1(12),long1(26),sig1(9); input : period(20); input : Per(30); var : MACDO1(0,Data1),Mav2(0,Data2); MACDO1 = Data1(MACD_OSC(short1,long1,sig1)); Mav2 = Data2(ma(C,period)); if MarketPosition == 0 and Data2(CrossUp(c,Mav2)) Then Buy(); if MarketPosition == 1 Then { if data1(CrossDown(MACDO1,0)) Then ExitLong("bx1",OnClose,Def,"",Ceiling(MaxContracts*(Per/100)/10)*10,2); if data2(CrossDown(c,Mav2)) Then ExitLong("bx2"); } 즐거운 하루되세요 > 2685up 님이 쓴 글입니다. > 제목 : 문의드립니다, > 수고하십니다. 아래수식을 data2를 macd말고 이동평균선으로 변경부탁드립니다. input : short1(12),long1(26),sig1(9); input : short2(12),long2(26),sig2(9); input : Per(30); var : MACDO1(0,Data1),MACDO2(0,Data2); MACDO1 = Data1(MACD_OSC(short1,long1,sig1)); MACDO2 = Data2(MACD_OSC(short2,long2,sig2)); if MarketPosition == 0 and Data2(CrossUp(MACDO2,0)) Then Buy(); if MarketPosition == 1 Then { if data1(CrossDown(MACDO1,0)) Then ExitLong("bx1",OnClose,Def,"",Ceiling(MaxContracts*(Per/100)/10)*10,2); if data2(CrossDown(MACDO2,0)) Then ExitLong("bx2"); } 감사합니다