커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

array

안녕하세요? StandardDevArray(arr,10,1);에서 - 괄호 우측 1은 무엇인가요? - 2, 3으로 변경해도 결과가 같습니다
프로필 이미지
코퍼
2023-08-22
1083
글번호 171758
시스템
답변완료

83425번 2항 문의사항 입니다.

83425번 2번항에 해당되는 파인스크립 을 예스 수식으로 변환 부탁드립니다 에서 변환해주신 수식 적용하니 지표가 트레이딩뷰차트랑 예스차트랑 다르게 표기 됩니다. 파일 첨부 하오니 검토 부탁 드리겠습니다. 아래: 파인스크립트 수식 83425번 2번항 atr_length = input(500) start = input(500) increment = input(500) maximum = input(500) entry_bars = input(500, title='Entry on Nth trend bar') atr = ta.atr(atr_length) atr := na(atr) ? ta.tr : atr psar = 0.0 // PSAR af = 0.0 // Acceleration Factor trend_dir = 0 // Current direction of PSAR ep = 0.0 // Extreme point trend_bars = 0 sar_long_to_short = trend_dir[1] == 1 and close <= psar[1] // PSAR switches from long to short sar_short_to_long = trend_dir[1] == -1 and close >= psar[1] // PSAR switches from short to long trend_change = barstate.isfirst[1] or sar_long_to_short or sar_short_to_long // Calculate trend direction trend_dir := barstate.isfirst[1] and close[1] > open[1] ? 1 : barstate.isfirst[1] and close[1] <= open[1] ? -1 : sar_long_to_short ? -1 : sar_short_to_long ? 1 : nz(trend_dir[1]) trend_bars := sar_long_to_short ? -1 : sar_short_to_long ? 1 : trend_dir == 1 ? nz(trend_bars[1]) + 1 : trend_dir == -1 ? nz(trend_bars[1]) - 1 : nz(trend_bars[1]) // Calculate Acceleration Factor af := trend_change ? start : trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] ? math.min(maximum, af[1] + increment) : af[1] // Calculate extreme point ep := trend_change and trend_dir == 1 ? high : trend_change and trend_dir == -1 ? low : trend_dir == 1 ? math.max(ep[1], high) : math.min(ep[1], low) // Calculate PSAR psar := barstate.isfirst[1] and close[1] > open[1] ? low[1] : barstate.isfirst[1] and close[1] <= open[1] ? high[1] : trend_change ? ep[1] : trend_dir == 1 ? psar[1] + af * atr : psar[1] - af * atr plot(psar, style=plot.style_cross, color=trend_dir == 1 ? color.green : color.red, linewidth=2) // Strategy strategy.entry('Long', strategy.long, when=trend_bars == entry_bars) strategy.entry('Short', strategy.short, when=trend_bars == -entry_bars) --------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------- 아래: 변환해주신 수식 입니다. 2-1 지표 input : atr_length(500),start(500),increment(500),maximum(500),entry_bars(500); var : atrv(0),psar(0),af(0),trend_dir(0),ep(0),trend_bars(0); var : sar_long_to_short(False),sar_short_to_long(False); var : trend_change(False); atrv = atr(atr_length); atrv = iff(IsNan(atrv) == true ,TrueRange , atrv); psar = 0.0; // PSAR af = 0.0; // Acceleration Factor trend_dir = 0; // Current direction of PSAR ep = 0.0; // Extreme point trend_bars = 0; sar_long_to_short = trend_dir[1] == 1 and close <= psar[1]; // PSAR switches from long to short sar_short_to_long = trend_dir[1] == -1 and close >= psar[1]; // PSAR switches from short to long trend_change = sar_long_to_short or sar_short_to_long; // Calculate trend direction trend_dir = iff(close[1] > open[1] , 1 , IFf(close[1] <= open[1] , -1 , IFf(sar_long_to_short , -1 , iff(sar_short_to_long , 1 , iff(isnan(trend_dir[1])==False,trend_dir[1],0))))); trend_bars = iff(sar_long_to_short , -1 , IFf(sar_short_to_long , 1 , iff(trend_dir == 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0)+ 1 , IFf( trend_dir == -1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) - 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) )))); // Calculate Acceleration Factor af = iff(trend_change , start , iff(trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] , min(maximum, af[1] + increment) , af[1])); // Calculate extreme point ep = iff(trend_change and trend_dir == 1 , high , iff(trend_change and trend_dir == -1 , low , iff(trend_dir == 1 , max(ep[1], high) , min(ep[1], low)))); // Calculate PSAR psar = iff(close[1] > open[1] , low[1] , IFf(close[1] <= open[1] , high[1] , IFf(trend_change , ep[1] , IFf(trend_dir == 1 , psar[1] + af * atrv , psar[1] - af * atrv)))); plot1(psar,"psar",iff(trend_dir == 1 , green , red)); 2-2 시스템 input : atr_length(500),start(500),increment(500),maximum(500),entry_bars(500); var : atrv(0),psar(0),af(0),trend_dir(0),ep(0),trend_bars(0); var : sar_long_to_short(False),sar_short_to_long(False); var : trend_change(False); atrv = atr(atr_length); atrv = iff(IsNan(atrv) == true ,TrueRange , atrv); psar = 0.0; // PSAR af = 0.0; // Acceleration Factor trend_dir = 0; // Current direction of PSAR ep = 0.0; // Extreme point trend_bars = 0; sar_long_to_short = trend_dir[1] == 1 and close <= psar[1]; // PSAR switches from long to short sar_short_to_long = trend_dir[1] == -1 and close >= psar[1]; // PSAR switches from short to long trend_change = sar_long_to_short or sar_short_to_long; // Calculate trend direction trend_dir = iff(close[1] > open[1] , 1 , IFf(close[1] <= open[1] , -1 , IFf(sar_long_to_short , -1 , iff(sar_short_to_long , 1 , iff(isnan(trend_dir[1])==False,trend_dir[1],0))))); trend_bars = iff(sar_long_to_short , -1 , IFf(sar_short_to_long , 1 , iff(trend_dir == 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0)+ 1 , IFf( trend_dir == -1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) - 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) )))); // Calculate Acceleration Factor af = iff(trend_change , start , iff(trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] , min(maximum, af[1] + increment) , af[1])); // Calculate extreme point ep = iff(trend_change and trend_dir == 1 , high , iff(trend_change and trend_dir == -1 , low , iff(trend_dir == 1 , max(ep[1], high) , min(ep[1], low)))); // Calculate PSAR psar = iff(close[1] > open[1] , low[1] , IFf(close[1] <= open[1] , high[1] , IFf(trend_change , ep[1] , IFf(trend_dir == 1 , psar[1] + af * atrv , psar[1] - af * atrv)))); IF trend_bars == entry_bars TheN Buy(); IF trend_bars == -entry_bars TheN Sell(); 2-3 종목검색 input : atr_length(500),start(500),increment(500),maximum(500),entry_bars(500); var : atrv(0),psar(0),af(0),trend_dir(0),ep(0),trend_bars(0); var : sar_long_to_short(False),sar_short_to_long(False); var : trend_change(False); atrv = atr(atr_length); atrv = iff(IsNan(atrv) == true ,TrueRange , atrv); psar = 0.0; // PSAR af = 0.0; // Acceleration Factor trend_dir = 0; // Current direction of PSAR ep = 0.0; // Extreme point trend_bars = 0; sar_long_to_short = trend_dir[1] == 1 and close <= psar[1]; // PSAR switches from long to short sar_short_to_long = trend_dir[1] == -1 and close >= psar[1]; // PSAR switches from short to long trend_change = sar_long_to_short or sar_short_to_long; // Calculate trend direction trend_dir = iff(close[1] > open[1] , 1 , IFf(close[1] <= open[1] , -1 , IFf(sar_long_to_short , -1 , iff(sar_short_to_long , 1 , iff(isnan(trend_dir[1])==False,trend_dir[1],0))))); trend_bars = iff(sar_long_to_short , -1 , IFf(sar_short_to_long , 1 , iff(trend_dir == 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0)+ 1 , IFf( trend_dir == -1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) - 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) )))); // Calculate Acceleration Factor af = iff(trend_change , start , iff(trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] , min(maximum, af[1] + increment) , af[1])); // Calculate extreme point ep = iff(trend_change and trend_dir == 1 , high , iff(trend_change and trend_dir == -1 , low , iff(trend_dir == 1 , max(ep[1], high) , min(ep[1], low)))); // Calculate PSAR psar = iff(close[1] > open[1] , low[1] , IFf(close[1] <= open[1] , high[1] , IFf(trend_change , ep[1] , IFf(trend_dir == 1 , psar[1] + af * atrv , psar[1] - af * atrv)))); IF trend_bars == entry_bars TheN find(1); 즐거운 하루되세요
프로필 이미지
하루삼프로
2023-08-22
1576
글번호 171757
지표
답변완료

전략실행차트 멀티 사용법

안녕하세요. 현재 전략실행차트를 통해 시스템트레이딩을 잘 활용하고 있는데요, 혹시 여러개의 차트를 동시에 활용해서 시스템을 만들 수 있나요? 그리고 수식 작성 시, 당일의 고점, 저점을 dayhigh[1], daylow[1] 함수를 활용하고 있는데요, 최근 한시간 이내의 고점, 저점을 계산해주는 함수가 따로 있을까요? 확인부탁드립니다. 감사합니다.
프로필 이미지
루루르
2023-08-22
1205
글번호 171754
시스템
답변완료

스토캐스틱 지표값이 다르게 나옵니다.

input : 모드("현재"); Input : period1(5), period2(3); var : minv(0),maxv(0); #모드 현재 또는 미래일때 표시 if 모드 == "현재" or 모드 == "미래" Then { Plot2((c-Lowest(l,period1))/(Highest(h,period1)-Lowest(l,period1))*100,"%K",rgb(255, 102, 0)); Plot4(ma((c-Lowest(l,period1))/(Highest(h,period1)-Lowest(l,period1))*100,period2),"%D",rgb(141, 26, 130)); } 이렇게 공식으로 스토캐스틱 현재값을 구현했을 때 실제로 트렌즈차트에 적용되어 있는 스토캐스틱과 비교했을 때 값이 다르게 나올 경우, 어떤 문제가 있다고 보시는지요? 식의 문제인건지..아니면 스토캐스틱을 구하는 다른 방식이 있는 것인지 궁금합니다. 트렌즈차트에 적용된 지표와 제가 만든 지표 사이의 괴리가 발생하는 이유를 알 수 있을까요?
프로필 이미지
이웃집고양이
2023-08-22
1139
글번호 171753
지표
답변완료

수식 문의

안녕하세요 .. 키움 신호 수식인데.. 예스 종목검색 수식으로 부탁드려요 A=MACD(5,10)-eavg(MACD(5,10),15); B=MACD(10,40)-eavg(MACD(10,40),80); CrossUp(A, B)
프로필 이미지
위피데이
2023-08-22
985
글번호 171738
종목검색

정구지 님에 의해서 삭제되었습니다.

프로필 이미지
정구지
2023-08-22
35
글번호 171737
시스템
답변완료

문의 드립니다.

아래 식에서 수량을 추가할 수 있도록 부탁드립니다. Input : Period(5); Var : value(0); value = ma(bids,period)-ma(asks,period); if CrossUp(value,0) Then Buy(); if CrossDown(value,0) Then ExitLong();
프로필 이미지
선물대장
2023-08-22
755
글번호 171736
시스템

정구지 님에 의해서 삭제되었습니다.

프로필 이미지
정구지
2023-08-22
37
글번호 171735
지표
답변완료

문의드립니다

안녕하세요? 아래수식에서 if var1 > var1[1] Then T = 1; else if var1 < var1[1] Then T = -1; Else T = 0; Plot1(var1,"1",iff(T==1,Red,iff(T==-1,Blue,Green))); 빨강선이 그린선으로바뀌었다 파랑선으로바뀌면 이란 조건문을 알고싶습니다 감사합니다
프로필 이미지
새벽에
2023-08-22
938
글번호 171734
지표
답변완료

문의드립니다.

LinRegSlope(C,20) 이 함수를 통해서 나오는 수치를 차트에서 해당기간 부분에 사선그리기로 표시할 수 있을까요? 단순수치는 어느정도의 각도인지 느낌이 잘 안오는 부분이 있어서 사선으로 표시해서 보고 싶습니다.
프로필 이미지
아름다운아침
2023-08-22
1301
글번호 171733
지표