커뮤니티

함수 추가 부탁드립니다.

프로필 이미지
바둑이
2019-07-04 10:45:40
255
글번호 130039
답변완료
안녕하세요. 아래 수식을 14:00 이전에는 하루에 한방향으로는 한번만 진입할 수 있도록 함수 추가 부탁드립니다. (즉, 하루에 매수로 1번만 진입 청산, 매도로 1번만 진입 청산 가능) 감사합니다. input : multi(0), entryday(80), exitday(80); var : cons(0); if multi == 1 then cons =5000 / (StD(close - close[2], 60) * bigpointvalue); else cons =1 ; if cons<1 then cons =1; Buy ("buy", AtStop, highest(high, entryday), cons); sell("sell",AtStop, lowest(low, entryday), cons); exitlong("exit-ln", AtStop, lowest(low, exitday)); exitshort("sel-sh", AtStop, highest(high, exitday));
사용자 함수
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-07-04 11:30:24

안녕하세요 예스스탁입니다. input : multi(0), entryday(80), exitday(80); var : cons(0); var : Bcnt(0),Scnt(0); if bdate != bdate[1] Then { Bcnt = 0; Scnt = 0; } if MarketPosition == 1 and MarketPosition != MarketPosition[1] Then Bcnt = Bcnt+1; if MarketPosition == -1 and MarketPosition != MarketPosition[1] Then Scnt = Scnt+1; if multi == 1 then cons =5000 / (StD(close - close[2], 60) * bigpointvalue); else cons =1 ; if cons<1 then cons =1; if Bcnt < 1 and stime < 140000 then Buy ("buy", AtStop, highest(high, entryday), cons); if Scnt < 1 and stime < 140000 then sell("sell",AtStop, lowest(low, entryday), cons); exitlong("exit-ln", AtStop, lowest(low, exitday)); exitshort("sel-sh", AtStop, highest(high, exitday)); 즐거운 하루되세요 > 바둑이 님이 쓴 글입니다. > 제목 : 함수 추가 부탁드립니다. > 안녕하세요. 아래 수식을 14:00 이전에는 하루에 한방향으로는 한번만 진입할 수 있도록 함수 추가 부탁드립니다. (즉, 하루에 매수로 1번만 진입 청산, 매도로 1번만 진입 청산 가능) 감사합니다. input : multi(0), entryday(80), exitday(80); var : cons(0); if multi == 1 then cons =5000 / (StD(close - close[2], 60) * bigpointvalue); else cons =1 ; if cons<1 then cons =1; Buy ("buy", AtStop, highest(high, entryday), cons); sell("sell",AtStop, lowest(low, entryday), cons); exitlong("exit-ln", AtStop, lowest(low, exitday)); exitshort("sel-sh", AtStop, highest(high, exitday));