커뮤니티

문의드립니다

프로필 이미지
믿음
2014-03-17 23:49:02
132
글번호 73571
답변완료
35466질문에 대한 답변식 이 안되는데 좀 봐주세요 제목 : 문의 드립니다 > 매수후 매도신호 발생시(손해일때는) 매수분의 2배로 매도 (이익상태면 매수분 청산+ 매도1배 진입) 다시 손실난 상태로 매수신호 발생하면 역시 기진입된 매도분의 2배로 매수 진입 (이익상태면 매도분 청산 +매수1배 진입) 또 손실상태에서 매도신호 발생시 역시 기진입된 매수분의 2배로 매도 진입.... (이익 상태면 기존 매수분은 청산 +매도1배 진입) 식 부탁드립니다 input : 기본진입수량(1); if c>ma(c,5) Then{ if MarketPosition == 0 and PositionProfit(1) > 0 Then buy("b11",OnClose,def,기본진입수량); if MarketPosition == 0 and PositionProfit(1) < 0 Then buy("b12",OnClose,def,CurrentContracts[BarsSinceEntry]*2); if MarketPosition == -1 and C <= EntryPrice Then buy("b21",OnClose,def,기본진입수량 ); if MarketPosition == -1 and C > EntryPrice Then buy("b22",OnClose,def,CurrentContracts[BarsSinceEntry]*2); } if c<ma(c,5) Then{ if MarketPosition == 0 and PositionProfit(1) > 0 Then Sell("s11",OnClose,def,기본진입수량); if MarketPosition == 0 and PositionProfit(1) < 0 Then Sell("s12",OnClose,def,CurrentContracts[BarsSinceEntry]*2); if MarketPosition == 1 and C >= EntryPrice Then Sell("s21",OnClose,def,기본진입수량 ); if MarketPosition == 1 and C < EntryPrice Then Sell("s22",OnClose,def,CurrentContracts[BarsSinceEntry]*2); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2014-03-18 16:18:03

안녕하세요 예스스탁입니다. 식을 수정했습니다. 차트상 첫거래가 없어 직전거래의 손익판단이 되지 않아 신호가 발생하지 않았습니다. 첫거래는 매수부터 시작하도록 했습니다. input : 기본진입수량(1); if c>ma(c,5) Then{ if TotalTrades == 0 or (MarketPosition == 0 and PositionProfit(1) > 0) Then buy("b11",OnClose,def,기본진입수량); if MarketPosition == 0 and PositionProfit(1) < 0 Then buy("b12",OnClose,def,CurrentContracts[BarsSinceEntry]*2); if MarketPosition == -1 and C <= EntryPrice Then buy("b21",OnClose,def,기본진입수량 ); if MarketPosition == -1 and C > EntryPrice Then buy("b22",OnClose,def,CurrentContracts*2); } if c<ma(c,5) Then{ if (MarketPosition == 0 and PositionProfit(1) > 0) Then Sell("s11",OnClose,def,기본진입수량); if MarketPosition == 0 and PositionProfit(1) < 0 Then Sell("s12",OnClose,def,CurrentContracts[BarsSinceEntry]*2); if MarketPosition == 1 and C >= EntryPrice Then Sell("s21",OnClose,def,기본진입수량 ); if MarketPosition == 1 and C < EntryPrice Then Sell("s22",OnClose,def,CurrentContracts*2); } 즐거운 하루되세요 > 믿음 님이 쓴 글입니다. > 제목 : 문의드립니다 > 35466질문에 대한 답변식 이 안되는데 좀 봐주세요 제목 : 문의 드립니다 > 매수후 매도신호 발생시(손해일때는) 매수분의 2배로 매도 (이익상태면 매수분 청산+ 매도1배 진입) 다시 손실난 상태로 매수신호 발생하면 역시 기진입된 매도분의 2배로 매수 진입 (이익상태면 매도분 청산 +매수1배 진입) 또 손실상태에서 매도신호 발생시 역시 기진입된 매수분의 2배로 매도 진입.... (이익 상태면 기존 매수분은 청산 +매도1배 진입) 식 부탁드립니다 input : 기본진입수량(1); if c>ma(c,5) Then{ if MarketPosition == 0 and PositionProfit(1) > 0 Then buy("b11",OnClose,def,기본진입수량); if MarketPosition == 0 and PositionProfit(1) < 0 Then buy("b12",OnClose,def,CurrentContracts[BarsSinceEntry]*2); if MarketPosition == -1 and C <= EntryPrice Then buy("b21",OnClose,def,기본진입수량 ); if MarketPosition == -1 and C > EntryPrice Then buy("b22",OnClose,def,CurrentContracts[BarsSinceEntry]*2); } if c<ma(c,5) Then{ if MarketPosition == 0 and PositionProfit(1) > 0 Then Sell("s11",OnClose,def,기본진입수량); if MarketPosition == 0 and PositionProfit(1) < 0 Then Sell("s12",OnClose,def,CurrentContracts[BarsSinceEntry]*2); if MarketPosition == 1 and C >= EntryPrice Then Sell("s21",OnClose,def,기본진입수량 ); if MarketPosition == 1 and C < EntryPrice Then Sell("s22",OnClose,def,CurrentContracts[BarsSinceEntry]*2); }