커뮤니티

59172대한 추가 질문입니다

프로필 이미지
초짜79
2018-08-30 22:53:26
127
글번호 121766
답변완료
수식 정말 고맙습니다 공부가 많이 되고 있습니다 궁금한건 장대 봉이 발생하여 3계약이 전부 청산되었는데 다시 장대 봉 발생한(청산이 이루어진 캔들에서) 곳에서 바로 매수주문이 다시 들어갔는데 전부 청산된 뒤에는 다음 봉에서 조건이 이루어졌을때만 진입이 되게 하려면 어떻게 해야될까요? 물론 청산이 이루어진 봉 다음 봉에 조건이 안맞으면 진입이 안되야되겠죠~ 수식 부탁합니다. 미리 감사드려요 안녕하세요 예스스탁입니다. Var : p1(20),p2(150); Var : sto1(20),sto2(5),sto3(5); var : ma1(0),ma2(0),stok(0),stod(0); ma1 = ma(C,P1); ma2 = ma(C,P2); stok = StochasticsK(sto1,sto2); stod = StochasticsD(sto1,sto2,sto3); condition1 = ma1 > ma2 and stok > stod; condition2 = ma1 < ma2 and stok < stod; if stime >= 100000 or stime <050000 then { if condition1 == true and condition1[1] == false then { if MarketPosition == 0 or (MarketPosition == -1 and (C > dayopen or C >= EntryPrice+PriceScale*20)) then buy("매수",OnClose,def,3); } if condition2 == true and condition2[1] == false then { if MarketPosition == 0 or (MarketPosition == 1 and (C < dayopen or C <= EntryPrice-PriceScale*20)) then sell("매도",OnClose,def,3); } } if MarketPosition == 1 then { ExitLong("bp1",atlimit,EntryPrice+PriceScale*20,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*40,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*60,"",1,1); if CurrentContracts == MaxContracts Then ExitLong("bl1",AtStop,EntryPrice-PriceScale*20); else ExitLong("bl2",AtStop,EntryPrice+PriceScale*5); } if MarketPosition == -1 then { ExitShort("sp1",atlimit,EntryPrice-PriceScale*20,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*40,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*60,"",1,1); if CurrentContracts == MaxContracts Then ExitShort("sl1",AtStop,EntryPrice+PriceScale*20); else ExitShort("sl2",AtStop,EntryPrice-PriceScale*5); } if stime == 050000 then { exitlong(); exitshort(); } 즐거운 하루되세요 > 초짜79 님이 쓴 글입니다. > 제목 : 59140 질문 다시 부탁합니다! > 대입을 해도 잘 안되서 다시 문의 합니다 현재 쓰고 있는 수식입니다 여기에 아래내용을 같이 적용을 시키려면 어떻게 해야될까요? 예를들어 아래수식대로 시가위에서 매수진입신호(condition1)가 나온 뒤에 매도진입신호(condition2)가 나오는 조건이 되어도 진입가격보다 가격이 낮지 않거나 시가보다 가격이 작지 않을경우는 매도 신호는 안나왔으면 좋겠구요 매도신호가 나오려면 시가보다 가격이 작아졌졌거나 진입가격보다 20틱아래있을때 매도조건(cindition2)이 충족되면 매도 신호(손절및 매도진입)가 나왔으면 좋겠습니다 (*진입한 계약이 없을경우에는 시가 밑에서도 매수신호가 나오고 시가 위에서도 매도신호가 나오도록 해주세요) 진입할때 3계약진입하고 20틱에서 1계약청산 40틱에서 1계약청산 60틱에서 1계약청산하고 1계약도 청산이 안됐을때 진입가격에서 20틱이하로 내려가면 손절하고 1계약이라도 청산된 뒤 남은은계약이 있을때는 진입가격보다 5틱위에서 전부청산되는 수식부탁합니다. 그리고 추가해서 20일선이 150일선을 상향크로스하고 스토캐스틱이 기준선 20을 상향돌파하거나 기준선 80을 상향돌파할때 "매수" 그 반대일땐 "매도" 아래수식에 대입해서 부탁합니다 Var : p1(20),p2(150); Var : sto1(20),sto2(5),sto3(5); condition1 = ma1 > ma2 and stok > stod condition2 = ma1 < ma2 and stok < stod if stime >= 100000 or stime <050000 then{ if condition1 == true and condition1[1] == false then buy("매수"); if condition2 == true and condition2[1] == false then sell("매도"); } if stime == 050000 then{ exitlong(); exitshort(); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-08-31 11:24:18

안녕하세요 예스스탁입니다. 청산이 발생한 봉에서는 진입을 하지 않게 수정했습니다. Var : p1(20),p2(150); Var : sto1(20),sto2(5),sto3(5); var : ma1(0),ma2(0),stok(0),stod(0); ma1 = ma(C,P1); ma2 = ma(C,P2); stok = StochasticsK(sto1,sto2); stod = StochasticsD(sto1,sto2,sto3); condition1 = ma1 > ma2 and stok > stod; condition2 = ma1 < ma2 and stok < stod; if stime >= 100000 or stime <050000 then { if condition1 == true and condition1[1] == false and TotalTrades == TotalTrades[1] then { if (MarketPosition == 0) or (MarketPosition == -1 and (C > dayopen or C >= EntryPrice+PriceScale*20)) then buy("매수",OnClose,def,3); } if condition2 == true and condition2[1] == false and TotalTrades == TotalTrades[1] then { if (MarketPosition == 0 ) or (MarketPosition == 1 and (C < dayopen or C <= EntryPrice-PriceScale*20)) then sell("매도",OnClose,def,3); } } if MarketPosition == 1 then { ExitLong("bp1",atlimit,EntryPrice+PriceScale*20,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*40,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*60,"",1,1); if CurrentContracts == MaxContracts Then ExitLong("bl1",AtStop,EntryPrice-PriceScale*20); else ExitLong("bl2",AtStop,EntryPrice+PriceScale*5); } if MarketPosition == -1 then { ExitShort("sp1",atlimit,EntryPrice-PriceScale*20,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*40,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*60,"",1,1); if CurrentContracts == MaxContracts Then ExitShort("sl1",AtStop,EntryPrice+PriceScale*20); else ExitShort("sl2",AtStop,EntryPrice-PriceScale*5); } if stime == 050000 then { exitlong(); exitshort(); } 즐거운 하루되세요 > 초짜79 님이 쓴 글입니다. > 제목 : 59172대한 추가 질문입니다 > 수식 정말 고맙습니다 공부가 많이 되고 있습니다 궁금한건 장대 봉이 발생하여 3계약이 전부 청산되었는데 다시 장대 봉 발생한(청산이 이루어진 캔들에서) 곳에서 바로 매수주문이 다시 들어갔는데 전부 청산된 뒤에는 다음 봉에서 조건이 이루어졌을때만 진입이 되게 하려면 어떻게 해야될까요? 물론 청산이 이루어진 봉 다음 봉에 조건이 안맞으면 진입이 안되야되겠죠~ 수식 부탁합니다. 미리 감사드려요 안녕하세요 예스스탁입니다. Var : p1(20),p2(150); Var : sto1(20),sto2(5),sto3(5); var : ma1(0),ma2(0),stok(0),stod(0); ma1 = ma(C,P1); ma2 = ma(C,P2); stok = StochasticsK(sto1,sto2); stod = StochasticsD(sto1,sto2,sto3); condition1 = ma1 > ma2 and stok > stod; condition2 = ma1 < ma2 and stok < stod; if stime >= 100000 or stime <050000 then { if condition1 == true and condition1[1] == false then { if MarketPosition == 0 or (MarketPosition == -1 and (C > dayopen or C >= EntryPrice+PriceScale*20)) then buy("매수",OnClose,def,3); } if condition2 == true and condition2[1] == false then { if MarketPosition == 0 or (MarketPosition == 1 and (C < dayopen or C <= EntryPrice-PriceScale*20)) then sell("매도",OnClose,def,3); } } if MarketPosition == 1 then { ExitLong("bp1",atlimit,EntryPrice+PriceScale*20,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*40,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*60,"",1,1); if CurrentContracts == MaxContracts Then ExitLong("bl1",AtStop,EntryPrice-PriceScale*20); else ExitLong("bl2",AtStop,EntryPrice+PriceScale*5); } if MarketPosition == -1 then { ExitShort("sp1",atlimit,EntryPrice-PriceScale*20,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*40,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*60,"",1,1); if CurrentContracts == MaxContracts Then ExitShort("sl1",AtStop,EntryPrice+PriceScale*20); else ExitShort("sl2",AtStop,EntryPrice-PriceScale*5); } if stime == 050000 then { exitlong(); exitshort(); } 즐거운 하루되세요 > 초짜79 님이 쓴 글입니다. > 제목 : 59140 질문 다시 부탁합니다! > 대입을 해도 잘 안되서 다시 문의 합니다 현재 쓰고 있는 수식입니다 여기에 아래내용을 같이 적용을 시키려면 어떻게 해야될까요? 예를들어 아래수식대로 시가위에서 매수진입신호(condition1)가 나온 뒤에 매도진입신호(condition2)가 나오는 조건이 되어도 진입가격보다 가격이 낮지 않거나 시가보다 가격이 작지 않을경우는 매도 신호는 안나왔으면 좋겠구요 매도신호가 나오려면 시가보다 가격이 작아졌졌거나 진입가격보다 20틱아래있을때 매도조건(cindition2)이 충족되면 매도 신호(손절및 매도진입)가 나왔으면 좋겠습니다 (*진입한 계약이 없을경우에는 시가 밑에서도 매수신호가 나오고 시가 위에서도 매도신호가 나오도록 해주세요) 진입할때 3계약진입하고 20틱에서 1계약청산 40틱에서 1계약청산 60틱에서 1계약청산하고 1계약도 청산이 안됐을때 진입가격에서 20틱이하로 내려가면 손절하고 1계약이라도 청산된 뒤 남은은계약이 있을때는 진입가격보다 5틱위에서 전부청산되는 수식부탁합니다. 그리고 추가해서 20일선이 150일선을 상향크로스하고 스토캐스틱이 기준선 20을 상향돌파하거나 기준선 80을 상향돌파할때 "매수" 그 반대일땐 "매도" 아래수식에 대입해서 부탁합니다 Var : p1(20),p2(150); Var : sto1(20),sto2(5),sto3(5); condition1 = ma1 > ma2 and stok > stod condition2 = ma1 < ma2 and stok < stod if stime >= 100000 or stime <050000 then{ if condition1 == true and condition1[1] == false then buy("매수"); if condition2 == true and condition2[1] == false then sell("매도"); } if stime == 050000 then{ exitlong(); exitshort(); }