커뮤니티

문의

프로필 이미지
쿠루드
2014-11-06 10:52:28
132
글번호 80147
답변완료
안녕하세요. 38833에 대한 문의로 제가 아래의 식을 유도했는데요.. 약간의 문제와 수정을 부탁합니다. 1. 매수매도 진입이 봉이 완성되기 전에 가격조건에 맞으면 실시간으로 하고 싶습니다. 2. 진입후 손절가 또는 이익 청산가가 아니면 신호가 바뀌거나 손절, 이익청산하지 않도록 하고 싶습니다. 감사합니다. -------------------------------------------------------------------------- input : N(0.1),loss(0.2),Profit(0.5); var1 = ma(c,5); var2 = ma(c,20); if dayindex+1 >= 20 and stime < 145000 Then { if MarketPosition <= 0 and var2 > var2[1] and C <= var1-N and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) != 0)) Then { buy("b"); ExitLong("bx1",AtStop,C-loss); ExitLong("bx2",AtLimit,C+Profit); Text_New(sdate,stime,H+PriceScale*2,NumToStr(var1-N,2)); } if MarketPosition >= 0 and var2 < var2[1] and C >= var1+N and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) != 0)) Then { sell("s"); ExitShort("sx1",AtStop,C+loss); ExitShort("sx2",AtLimit,C-Profit); Text_New(sdate,stime,L-PriceScale*2,NumToStr(var1+N,2)); } } if MarketPosition == 1 Then{ ExitLong("bx11",AtStop,EntryPrice-loss); ExitLong("bx12",AtLimit,EntryPrice+Profit); } if MarketPosition == -1 then{ ExitShort("sx11",AtStop,EntryPrice+loss); ExitShort("sx21",AtLimit,EntryPrice-Profit); } SetStopEndofday(145900);
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2014-11-06 18:59:52

안녕하세요 예스스탁입니다. input : N(0.1),loss(0.2),Profit(0.5); var1 = ma(c,5); var2 = ma(c,20); if dayindex+1 >= 20 and stime < 145000 Then { if MarketPosition == 0 and var2 > var2[1] and L > var1-N and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) != 0)) Then { buy("b",AtStop,var1-N); ExitLong("bx1",AtStop,C-loss); ExitLong("bx2",AtLimit,C+Profit); Text_New(sdate,stime,H+PriceScale*2,NumToStr(var1-N,2)); } if MarketPosition == 0 and var2 < var2[1] and H < var1+N and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) != 0)) Then { sell("s",AtStop,var1+N); ExitShort("sx1",AtStop,C+loss); ExitShort("sx2",AtLimit,C-Profit); Text_New(sdate,stime,L-PriceScale*2,NumToStr(var1+N,2)); } } if MarketPosition == 1 Then{ ExitLong("bx11",AtStop,EntryPrice-loss); ExitLong("bx12",AtLimit,EntryPrice+Profit); } if MarketPosition == -1 then{ ExitShort("sx11",AtStop,EntryPrice+loss); ExitShort("sx21",AtLimit,EntryPrice-Profit); } SetStopEndofday(145900); 즐거운 하루되세요 > 쿠루드 님이 쓴 글입니다. > 제목 : 문의 > 안녕하세요. 38833에 대한 문의로 제가 아래의 식을 유도했는데요.. 약간의 문제와 수정을 부탁합니다. 1. 매수매도 진입이 봉이 완성되기 전에 가격조건에 맞으면 실시간으로 하고 싶습니다. 2. 진입후 손절가 또는 이익 청산가가 아니면 신호가 바뀌거나 손절, 이익청산하지 않도록 하고 싶습니다. 감사합니다. -------------------------------------------------------------------------- input : N(0.1),loss(0.2),Profit(0.5); var1 = ma(c,5); var2 = ma(c,20); if dayindex+1 >= 20 and stime < 145000 Then { if MarketPosition <= 0 and var2 > var2[1] and C <= var1-N and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) != 0)) Then { buy("b"); ExitLong("bx1",AtStop,C-loss); ExitLong("bx2",AtLimit,C+Profit); Text_New(sdate,stime,H+PriceScale*2,NumToStr(var1-N,2)); } if MarketPosition >= 0 and var2 < var2[1] and C >= var1+N and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) != 0)) Then { sell("s"); ExitShort("sx1",AtStop,C+loss); ExitShort("sx2",AtLimit,C-Profit); Text_New(sdate,stime,L-PriceScale*2,NumToStr(var1+N,2)); } } if MarketPosition == 1 Then{ ExitLong("bx11",AtStop,EntryPrice-loss); ExitLong("bx12",AtLimit,EntryPrice+Profit); } if MarketPosition == -1 then{ ExitShort("sx11",AtStop,EntryPrice+loss); ExitShort("sx21",AtLimit,EntryPrice-Profit); } SetStopEndofday(145900);