커뮤니티

예스랭귀지 Q&A

글쓰기

sline166 님에 의해서 삭제되었습니다.

프로필 이미지
sline166
2023-05-07
6
글번호 168751
사용자 함수
답변완료

RSI교차식

안녕하세요!!! 도움 청합니다 RSI크로스 할때마다 3전캔들의 가격을 저장하여 표시하고자 합니다. 아래의 식으로는 다른곳을 표시 합니다. 수고 부탁드리 겠습니다. Input : Period(9), maPeriod(14); var : RSI_V(0), MARSI(0); RSI_V = RSI(Period); MARSI = Ma(RSI_V,maPeriod); //RSI_V > MARSI and RSI_V[1] < MARSI[1] if RSI_V > MARSI and RSI_V[1] < MARSI[1] then { Var1 = L[3]; } if RSI_V < MARSI and RSI_V[1] > MARSI[1] then { Var2 = H[3]; } PlotBaseLine1(Var1, "Lrsi"); PlotBaseLine2(Var2, "HRsi");
프로필 이미지
불스아이
2023-05-07
1376
글번호 168750
지표
답변완료

수식작성 부탁드립니다.

안녕하세요. 운영자님 아래와 같은 트레이딩뷰 수식을 예스트레이더 수식으로 변환 꼭 좀 부탁드립니다. 감사합니다. 안녕하세요. 운영자님 아래와 같은 트레이딩뷰 수식을 예스트레이더 수식으로 변환 부탁드립니다. 감사합니다. // === INPUTS === // rsi rsiSource = input(defval = open, title = "RSI Source") rsiLength = input(defval = 8, title = "RSI Length", minval = 1) // sma maLength = input(defval = 34, title = "MA Period", minval = 1) // invert trade direction tradeInvert = input(defval = false, title = "Invert Trade Direction?") // risk management useStop = input(defval = false, title = "Use Initial Stop Loss?") slPoints = input(defval = 25, title = "Initial Stop Loss Points", minval = 1) useTS = input(defval = true, title = "Use Trailing Stop?") tslPoints = input(defval = 120, title = "Trail Points", minval = 1) useTSO = input(defval = false, title = "Use Offset For Trailing Stop?") tslOffset = input(defval = 20, title = "Trail Offset Points", minval = 1) // === /INPUTS === // === BASE FUNCTIONS === // delay for direction change actions switchDelay(exp, len) => average = len >= 2 ? sum(exp, len) / len : exp[1] up = exp > average down = exp < average state = up ? true : down ? false : up[1] // === /BASE FUNCTIONS === // === SERIES and VAR === // rsi shunt = rsiSource == open ? 0 : 1 rsiUp = rma(max(change(rsiSource[shunt]), 0), rsiLength) rsiDown = rma(-min(change(rsiSource[shunt]), 0), rsiLength) rsi = (rsiDown == 0 ? 100 : rsiUp == 0 ? 0 : 100 - (100 / (1 + rsiUp / rsiDown))) - 50 // shifted 50 points to make 0 median // sma of rsi rsiMa = sma(rsi, maLength) // self explanatory.. tradeDirection = tradeInvert ? 0 <= rsiMa ? true : false : 0 >= rsiMa ? true : false // === /SERIES === // === PLOTTING === barcolor(color = tradeDirection ? green : red, title = "Bar Colours") // hlines medianLine = hline(0, title = 'Median', color = #996600, linestyle = dotted, linewidth = 1) limitUp = hline(25, title = 'Limit Up', color = silver, linestyle = dotted, linewidth = 1) limitDown = hline(-25, title = 'Limit Down', color = silver, linestyle = dotted, linewidth = 1) // rsi and ma rsiLine = plot(rsi, title = 'RSI', color = purple, linewidth = 2, style = line, transp = 50) areaLine = plot(rsiMa, title = 'Area MA', color = silver, linewidth = 1, style = area, transp = 70) // === /PLOTTING === goLong() => not tradeDirection[1] and tradeDirection killLong() => tradeDirection[1] and not tradeDirection strategy.entry(id = "Buy", long = true, when = goLong()) strategy.close(id = "Buy", when = killLong()) goShort() => tradeDirection[1] and not tradeDirection killShort() => not tradeDirection[1] and tradeDirection strategy.entry(id = "Sell", long = false, when = goShort()) strategy.close(id = "Sell", when = killShort()) if (useStop) strategy.exit("XSL", from_entry = "Buy", loss = slPoints) strategy.exit("XSS", from_entry = "Sell", loss = slPoints) // if we're using the trailing stop if (useTS and useTSO) // with offset strategy.exit("XSL", from_entry = "Buy", trail_points = tslPoints, trail_offset = tslOffset) strategy.exit("XSS", from_entry = "Sell", trail_points = tslPoints, trail_offset = tslOffset) if (useTS and not useTSO) // without offset strategy.exit("XSL", from_entry = "Buy", trail_points = tslPoints) strategy.exit("XSS", from_entry = "Sell", trail_points = tslPoints)
프로필 이미지
고박사122
2023-05-07
1439
글번호 168749
시스템
답변완료

이건 왜 매매체결이 안되는지 봐도 잘 모르겠습니다 ㅠㅠ

Input : shortPeriod(12), longPeriod(26), Period(9); Var : MACDv(0), MACDsig(0),macdosc(0); MACDv = MACD(shortPeriod, longPeriod); if ATr(14)[1]>ATr(14) and macdv < 0 Then Sell(); macd 가 -이고 atr이 전봉 atr보다 줄어들면 매도하려는데 매수일때는 일단 거래가 체결은 됐었는데 매도로 가면 거래자체가 성사되지않는데 무엇이 문제인지 모르겠습니다
프로필 이미지
초심자의행운
2023-05-07
1283
글번호 168748
시스템
답변완료

막대그래프 표현식

안녕하세요 아래 지표식을 이용해서 첨부 그림처럼 종가가 상승시 저[1,1]이 기준선(PlotBaseLine?),RED막대, 반대로 종가가 하락시 고[1,1]이 기준선,BLUE막대로 표현되는 지표식 부탁드립니다 감사합니다 Input:length(10),종가사용여부(0),파동선두께(2),수치표시(1); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(종가사용여부==1,C,H); LL = IFF(종가사용여부==1,C,L); If Index == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = Highest(HH,length) == HH and 최종고가 <> HH; Condition2 = Lowest (LL,length) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = Index; 고[1,3] = sDate; 고[1,4] = sTime; TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 수치표시 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 2, 1); } TL_SetSize(TL1,파동선두께); TL_SetColor(TL1,RED); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = Index; 고[1,3] = sDate; 고[1,4] = sTime; TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 수치표시 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = Index; 저[1,3] = sDate; 저[1,4] = sTime; TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 수치표시 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 2, 0); } TL_SetSize(TL1,파동선두께); TL_SetColor(TL1,BLUE); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = Index; 저[1,3] = sDate; 저[1,4] = sTime; TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 수치표시 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; }
프로필 이미지
bestkim
2023-05-07
1459
글번호 168747
지표

sline166 님에 의해서 삭제되었습니다.

프로필 이미지
sline166
2023-05-07
0
글번호 168746
사용자 함수
답변완료

문의

1. 스톡캐스틱과 ACD가 골든크로스 상태일떄에 이격이 상승전환할때 매수 반대의 경우 매도 2.스톡캐스틱과MACD가 골든크로스발생되는 시점에서 이격이 상승전환할때 매수 반대의 경우 매도 부탁드립니다.
프로필 이미지
엉덩공주
2023-05-06
1677
글번호 168745
시스템
답변완료

청산수식수정 부탁드립니다.

골든크로스 발생하면 해당봉 종가+조정틱이상 시세가 발생하면 매수하고 매수이후에 진입가 대비 감시틱수 이상 상승후 하락해서 진입가에 도달하면 청산됩니다. 반대로 골든크로스 발생하면 해당봉 종가-조정틱 이하 시세가 발생하면 매도하고 매도이후에 진입가 대비 감시틱수 이상 하락후 상승해서 진입가에 도달하면 청산됩니다. input : P1(20),P2(60),조정틱(5),감시틱수(22); var : mav1(0),mav2(0),T(0),B(0),S(0); mav1 = ma(C,P1); mav2 = ma(C,P2); if CrossUp(mav1,mav2) Then { T = 1; B = C; } if CrossDown(mav1,mav2) Then { T = -1; S = C; } if T == 1 and S > 0 Then Buy("b",AtStop,S+PriceScale*조정틱); if T == -1 Then Sell("S",AtStop,S-PriceScale*조정틱); if MarketPosition == 1 Then { B = 0; if highest(H,BarsSinceEntry) >= EntryPrice+감시틱수 Then ExitLong("bx",AtStop,EntryPrice); } if MarketPosition == -1 Then { S = 0; if Lowest(L,BarsSinceEntry) <= EntryPrice-감시틱수 Then ExitShort("sx",AtStop,EntryPrice); } //------------------------------------------------------ 진입가 청산을 하고 싶읍니다. 22틱이상 가격에서 하락 한다면 본절청산하라는 수식입니다 만.. 정상 작동 되지 않는 것 같아요... 수정 부탁드립니다. 이미지 첨부
프로필 이미지
왈라스
2023-05-06
1601
글번호 168744
시스템

신대륙발견 님에 의해서 삭제되었습니다.

프로필 이미지
신대륙발견
2023-05-06
24
글번호 168743
지표

2wnwn 님에 의해서 삭제되었습니다.

프로필 이미지
2wnwn
2023-05-07
86
글번호 168742
시스템