커뮤니티

수식 변환 부탁드립니다.

프로필 이미지
리턴
2018-04-09 19:40:25
218
글번호 118060
답변완료
안녕하세요? 아래 다른 언어의 코드를 예스랭귀지로 코딩 변환 부탁합니다. 감사합니다. -------------- //Sharing ProRealTime knowledge // --- settings //multiplier=2.236 //period=66 //type=1 //1 = use ATR , 2 = Use standard deviation , 3 = Use standard error //midperiod=10 // --- end of settings type=max(1,type) if type=1 then moy=averagetruerange[period](close) elsif type=2 then moy=std[period](close) elsif type=3 then moy=ste[period](close) endif price=(highest[midperiod](high)+lowest[midperiod](low))/2 up=price+multiplier*moy dn=price-multiplier*moy once trend=1 if close>up[1] then trend=1 elsif close<dn[1] then trend=-1 endif if trend<0 and trend[1]>0 then flag=1 else flag=0 endif if trend>0 and trend[1]<0 then flagh=1 else flagh=0 endif if trend>0 and dn<dn[1] then dn=dn[1] endif if trend<0 and up>up[1] then up=up[1] endif if flag=1 then up=price+multiplier*moy endif if flagh=1 then dn=price-multiplier*moy endif if trend=1 then mysupertrend=dn offset=moy color1=0 color2=191 color3=255 else mysupertrend=up offset=-moy color1=255 color2=69 color3=0 endif drawcandle(mysupertrend,mysupertrend+offset,mysupertrend,mysupertrend+offset) coloured(color1,color2,color3,50)bordercolor(100,100,100,0) if trend=1 and trend[1]<>1 then drawarrowup(barindex,mysupertrend) coloured(color1,color2,color3) endif if trend=-1 and trend[1]<>-1 then drawarrowdown(barindex,mysupertrend) coloured(color1,color2,color3) endif return mysupertrend coloured (color1,color2,color3) as "SuperTrend Extended 1", mysupertrend+offset coloured (color1,color2,color3) as "SuperTrend Extended 2"
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-04-10 11:33:42

안녕하세요 예스스탁입니다. 올려주신 랭귀지는 사용해본 경험이 없어 저희랭귀지로 변경을 해드릴수 없습니다. 도움을 드리지 못해 죄송합니다. 즐거운 하루되세요 > 리턴 님이 쓴 글입니다. > 제목 : 수식 변환 부탁드립니다. > 안녕하세요? 아래 다른 언어의 코드를 예스랭귀지로 코딩 변환 부탁합니다. 감사합니다. -------------- //Sharing ProRealTime knowledge // --- settings //multiplier=2.236 //period=66 //type=1 //1 = use ATR , 2 = Use standard deviation , 3 = Use standard error //midperiod=10 // --- end of settings type=max(1,type) if type=1 then moy=averagetruerange[period](close) elsif type=2 then moy=std[period](close) elsif type=3 then moy=ste[period](close) endif price=(highest[midperiod](high)+lowest[midperiod](low))/2 up=price+multiplier*moy dn=price-multiplier*moy once trend=1 if close>up[1] then trend=1 elsif close<dn[1] then trend=-1 endif if trend<0 and trend[1]>0 then flag=1 else flag=0 endif if trend>0 and trend[1]<0 then flagh=1 else flagh=0 endif if trend>0 and dn<dn[1] then dn=dn[1] endif if trend<0 and up>up[1] then up=up[1] endif if flag=1 then up=price+multiplier*moy endif if flagh=1 then dn=price-multiplier*moy endif if trend=1 then mysupertrend=dn offset=moy color1=0 color2=191 color3=255 else mysupertrend=up offset=-moy color1=255 color2=69 color3=0 endif drawcandle(mysupertrend,mysupertrend+offset,mysupertrend,mysupertrend+offset) coloured(color1,color2,color3,50)bordercolor(100,100,100,0) if trend=1 and trend[1]<>1 then drawarrowup(barindex,mysupertrend) coloured(color1,color2,color3) endif if trend=-1 and trend[1]<>-1 then drawarrowdown(barindex,mysupertrend) coloured(color1,color2,color3) endif return mysupertrend coloured (color1,color2,color3) as "SuperTrend Extended 1", mysupertrend+offset coloured (color1,color2,color3) as "SuperTrend Extended 2"