답변완료
수식 문의드립니다.
안녕하세요 해외선물에 이용하려 합니다.
보통 볼린저밴드가 (20,2) 이렇게 사용을 하는데요 (20,3)도 보이게 하고 싶습니다.
즉 차트 에 볼린저밴드 (20,2) 및 (20,3) 두개가 나오게 표시를 하구요.
그리고 스토캐스틱 SLOW는 12,5,5로 설정을 하려 합니다.
1시간 봉 기준으로 매매를 할 거고 총 2계약 매매를 하려 합니다.
(20,2) 볼린저 상단 돌파 및 스토캐스틱 SLOW %K가 80이상이면 1개 매도
(20,3) 볼린저 상단 돌파 스토캐스틱 SLOW %K가 80이상이면 1개 추가 매도
(20,2) 볼린저 하단 돌파 및 스토캐스틱 SLOW %K가 20이하이면 1개 매수
(20,3) 볼린저 상단 돌파 스토캐스틱 SLOW %K가 20이하면 1개 추가 매수
그리고 잡은 포지션에서 반대로 100틱 가면 시장가 청산
내 포지션 방향대로 100틱 가면 시장가 청산 이렇게 하려 합니다
(즉 100틱 익절 및 손절건다는 말입니다)
수식 부탁드릴게요 감사합니다!
2023-05-22
595
글번호 169148
지표
답변완료
수식 부탁드립니다
아래와 같은 수식을 예스랭귀지로 전환 부탁드립니다.
//PRC_BBands Stop | indicator
//30.03.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//translated from MT4 code
// --- settings
//Length=20 // Bollinger Bands Period
//Deviation=2 // Deviation
//MoneyRisk=1.00 // Offset Factor
// --- end of settings
avg=average[Length]
dev=std[Length]*Deviation
smax = avg+dev
smin = avg-dev
if close>smax[1] then
trend=1
endif
if close<smin[1] then
trend=-1
endif
if trend>0 and smin<smin[1] then
smin=smin[1]
endif
if trend<0 and smax>smax[1] then
smax=smax[1]
endif
bsmax=smax+0.5*(MoneyRisk-1)*(smax-smin)
bsmin=smin-0.5*(MoneyRisk-1)*(smax-smin)
if(trend>0 and bsmin<bsmin[1]) then
bsmin=bsmin[1]
endif
if(trend<0 and bsmax>bsmax[1]) then
bsmax=bsmax[1]
endif
if trend>0 then
TrendLine=bsmin
r=127
g=255
drawtext("•",barindex,bsmin,Dialog,Standard,10) coloured(r,g,0)
if trend[1]<0 then
drawtext("•",barindex,bsmin,Dialog,Standard,22) coloured(r,g,0)
endif
endif
if trend<0 then
TrendLine=bsmax
r=255
g=165
drawtext("•",barindex,bsmax,Dialog,Standard,10) coloured(r,g,0)
if trend[1]>0 then
drawtext("•",barindex,bsmax,Dialog,Standard,22) coloured(r,g,0)
endif
endif
RETURN TrendLine coloured(r,g,0) style(line,2) as "BBands stop Trend"
2023-05-19
721
글번호 169140
지표