커뮤니티

함수요청

프로필 이미지
통큰베팅
2018-02-28 10:08:36
179
글번호 117024
답변완료
안녕하세요? 함수 수정요청드립니다. 아래의 식에서 최근 5개봉을 당일 봉으로 한정하고자 합니다. 즉 아침에 시가봉이 생성되면 직전 전일 봉을 포함하여 카운팅하지 않고 당일 봉에서만 계산하여 매매하고자 합니다. if MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 5)) then{ buy("b",AtStop,highest(H,5)); sell("s",AtStop,lowest(H,5)); } SetStopProfittarget(PriceScale*50,PointStop); SetStopLoss(PriceScale*10,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-02-28 15:39:30

안녕하세요 예스스탁입니다. var : idx(0),hh(0),ll(0); if bdate != bdate[1] Then idx = 0; idx = idx+1; if idx < 5 Then{ hh = dayhigh; ll = daylow; } Else{ hh = highest(H,5); ll = lowest(L,5); } if MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 5)) then{ buy("b",AtStop,highest(H,5)); sell("s",AtStop,lowest(H,5)); } SetStopProfittarget(PriceScale*50,PointStop); SetStopLoss(PriceScale*10,PointStop); 즐거운 하루되세요 > 통큰베팅 님이 쓴 글입니다. > 제목 : 함수요청 > 안녕하세요? 함수 수정요청드립니다. 아래의 식에서 최근 5개봉을 당일 봉으로 한정하고자 합니다. 즉 아침에 시가봉이 생성되면 직전 전일 봉을 포함하여 카운팅하지 않고 당일 봉에서만 계산하여 매매하고자 합니다. if MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 5)) then{ buy("b",AtStop,highest(H,5)); sell("s",AtStop,lowest(H,5)); } SetStopProfittarget(PriceScale*50,PointStop); SetStopLoss(PriceScale*10,PointStop);