커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

변환부탁드립니다.

감사합니다. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // &#169; BobRivera990 //@version=4 study(title = "Trend Type Indicator by BobRivera990", overlay = false) //==========================================================================[Inputs]========================================================================== useAtr = input(true, title = "Use ATR to detect Sideways Movements") // Use Average True Range (ATR) to detect Sideways Movements atrLen = input(14, minval = 1, title = "ATR Length") // length of the Average True Range (ATR) used to detect Sideways Movements atrMaType = input("SMA", options = ["SMA", "EMA"], title = "ATR Moving Average Type") // Type of the moving average of the ATR used to detect Sideways Movements atrMaLen = input(20, minval = 1, title = "ATR MA Length") // length of the moving average of the ATR used to detect Sideways Movements useAdx = input(true, title = "Use ADX to detect Sideways Movements") // Use Average Directional Index (ADX) to detect Sideways Movements adxLen = input(14, minval = 1, maxval = 50, title = "ADX Smoothing") // length of the Average Directional Index (ADX) used to detect Sideways Movements diLen = input(14, minval = 1, title = "DI Length") // length of the Plus and Minus Directional Indicators (+DI & -DI) used to determine the direction of the trend adxLim = input(25, minval = 1, title = "ADX Limit") // A level of ADX used as the boundary between Trend Market and Sideways Market smooth = input(3, minval = 1, maxval = 5, title = "Smoothing Factor") // Factor used for smoothing the oscillator lag = input(8, minval = 0, maxval = 15, title = "Lag") // lag used to match indicator and chart //============================================================================================================================================================ //===================================================================[Initial Calculations]=================================================================== atr = atr(atrLen) // Calculate the Average True Range (ATR) atrMa = atrMaType == "EMA" ? ema(atr, atrMaLen) : sma(atr, atrMaLen) // Calculate the moving average of the ATR up = change(high) // Calculate parameter related to ADX, +DI and -DI down = -change(low) // Calculate parameter related to ADX, +DI and -DI plusDM = na(up) ? na : (up > down and up > 0 ? up : 0) // Calculate parameter related to ADX, +DI and -DI minusDM = na(down) ? na : (down > up and down > 0 ? down : 0) // Calculate parameter related to ADX, +DI and -DI trur = rma(tr, diLen) // Calculate parameter related to ADX, +DI and -DI plus = fixnan(100 * rma(plusDM, diLen) / trur) // Calculate Plus Directional Indicator (+DI) minus = fixnan(100 * rma(minusDM, diLen) / trur) // Calculate Minus Directional Indicator (-DI) sum = plus + minus // Calculate parameter related to ADX adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxLen) // Calculate Average Directional Index (ADX) //============================================================================================================================================================ //========================================================================[Conditions]======================================================================== cndNa = na(atr) or na(adx) or na(plus) or na(minus) or na(atrMaLen) // Conditions for lack of sufficient data for calculations cndSidwayss1 = useAtr and atr <= atrMa // Sideways Movement condition (based on ATR) cndSidwayss2 = useAdx and adx <= adxLim // Sideways Movement condition (based on ADX) cndSidways = cndSidwayss1 or cndSidwayss2 // General Sideways Movement condition cndUp = plus > minus // uptrend condition cndDown = minus >= plus // downtrend condition trendType = cndNa ? na : cndSidways ? 0 : cndUp ? 2 : -2 // Determine the type of trend smoothType = na(trendType) ? na : round(sma(trendType, smooth) / 2) * 2 // Calculate the smoothed trend type oscillator //============================================================================================================================================================ //=========================================================================[Drawing]========================================================================== colGreen30 = color.new(color.green, 30) // Define the color used in the drawings colGreen90 = color.new(color.green, 90) // Define the color used in the drawings colGray = color.new(color.gray, 20) // Define the color used in the drawings colWhite90 = color.new(color.white, 90) // Define the color used in the drawings colRed30 = color.new(color.red, 30) // Define the color used in the drawings colRed90 = color.new(color.red, 90) // Define the color used in the drawings band3 = plot(+3, title = "Band_3", color=color.black) // Draw the upper limit of the uptrend area band2 = plot(+1, title = "Band_2", color=color.black) // Draw the boundary between Sideways and Uptrend areas band1 = plot(-1, title = "Band_1", color=color.black) // Draw the boundary between Sideways and Downtrend areas band0 = plot(-3, title = "Band_0", color=color.black) // Draw the lower limit of the downtrend area fill(band2, band3, title = "Uptrend area", color = colGreen90) // Highlight the Uptrend area fill(band1, band2, title = "Sideways area", color = colWhite90) // Highlight the Sideways area fill(band0, band1, title = "Downtrend area", color = colRed90) // Highlight the Downtrend area var label lblUp = na label.delete(lblUp) lblUp := label.new(x = time, y = 2, text = "UP", color = color.new(color.green, 100), textcolor = color.black, style = label.style_label_left, xloc = xloc.bar_time, yloc = yloc.price, size=size.normal, textalign = text.align_left) // Show Uptrend area label var label lblSideways = na label.delete(lblSideways) lblSideways := label.new(x = time, y = 0, text = "SIDEWAYS", color = color.new(color.green, 100), textcolor = color.black, style = label.style_label_left, xloc = xloc.bar_time, yloc = yloc.price, size = size.normal, textalign = text.align_left) // Show Sideways area label var label lblDown = na label.delete(lblDown) lblDown := label.new(x = time, y = -2, text = "DOWN", color = color.new(color.green, 100), textcolor = color.black, style = label.style_label_left, xloc = xloc.bar_time, yloc = yloc.price, size = size.normal, textalign = text.align_left) // Show Downtrend area label var label lblCurrentType = na label.delete(lblCurrentType) lblCurrentType := label.new(x = time, y = smoothType, color = color.new(color.blue, 30), style = label.style_label_right, xloc = xloc.bar_time, yloc = yloc.price, size = size.small) // Show the latest status label trendCol = smoothType == 2 ? colGreen30 : smoothType == 0 ? colGray : colRed30 // Determine the color of the oscillator in different conditions plot(smoothType, title = "Trend Type Oscillator", color = trendCol, linewidth = 3, offset = -lag, style = plot.style_stepline) // Draw the trend type oscillator
프로필 이미지
코샘매쓰
2021-09-27
1709
글번호 152500
지표
답변완료

시스템식 문의 드립니다.

여러번 질문드려 죄송합니다.ㅜ.ㅜ 아침에 송부해주신 식을 기준으로 다시 시뮬레이션을 돌려봤더니.. 예를들어 아시아나 항공으로 1차 타점 : 28350 2차 타점 : 27800 3차 타점 : 27300 이렇게 타점을 걸어두고 매매를 진행되었을때 제가 생각하는 시뮬레이션은 28350에 매수해서 2프로 익절하고 , 그다음 27800원에 매수해서 2프로 익절하고, 27300원에서 매수해서 2프로 익절하는 식을 생각했었는데 아래의 그림을 보시면, 28350에 매수해서 2프로 익절후에 또 다시, 28350원에 진입하는걸 볼수 있습니다. 다시하면 조건을 적는다면.. 요청조건은 ------------------------------------------------------------------- 여기서 추가하고자 하는 조건은 전부다 동일한 조건으로 진행되는데, 1차매수 2프로 익절 했을 경우에만, 다음타점으로 매수진행되도록 조건을 추가하고 싶습니다. 예를들어 5000원에 매수해서 2프로 익절까지 했을경우, 다음 4500원이 매수타점으로 되어 진행되도록 조건을 추가하고자 합니다. ------------------------------------------------------------------- 입니다. 그럼 부탁드리겠습니다. 감사합니다. 요청식 ------------------------------------------------------------------- 안녕하세요 예스스탁입니다. 기존식은 기존의 2차진입가격을 그대로 적용했습니다. 첫타점 다음가격으로 지정해 드립니다. 첫타점이 타점5이면 다음가격이 없어 진입할 수 없습니다. input : 타점1(5000),타점2(4500),타점3(4000),타점4(3500),타점5(3000); input : 투자금액1(1000000),투자금액2(2000000); var : entry(0),HH(0),H1(0); if Bdate != Bdate[1] Then { entry = 0; #5개의 타점중 시가보다 작은것 중에 젤 큰값 계산 HH = 0; H1 = 0; if 타점1 < DayOpen*0.99 and 타점1 < DayClose(1) and 타점1 > HH Then { HH = 타점1; H1 = 타점2; } if 타점2 < DayOpen*0.99 and 타점2 < DayClose(1) and 타점2 > HH Then { HH = 타점2; H1 = 타점3; } if 타점3 < DayOpen*0.99 and 타점3 < DayClose(1) and 타점3 > HH Then { HH = 타점3; H1 = 타점4; } if 타점4 < DayOpen*0.99 and 타점4 < DayClose(1) and 타점4 > HH Then { HH = 타점4; H1 = 타점5; } if 타점5 < DayOpen*0.99 and 타점5 < DayClose(1) and 타점5 > HH Then { HH = 타점5; } } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) and (MarketPosition != MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition == 0 and sTime < 133000 and entry == 0 Then { Buy("1차매수",AtLimit,HH,Floor(투자금액1/min(NextBarOpen,HH))); } if MarketPosition == 1 and entry == 1 Then { Buy("2차매수",AtLimit,HH*0.974,Floor(투자금액2/min(NextBarOpen,HH*0.974))); } if MarketPosition == 0 and sTime < 133000 and entry == 1 and IsexitName("1차매수 2프로익절",1) == true and H1 > 0 Then { Buy("2차매수A",AtLimit,H1,Floor(투자금액2/min(NextBarOpen,HH*0.974))); } if MarketPosition == 1 Then { if MaxEntries == 1 and IsEntryName("1차매수",0) == true Then { ExitLong("1차매수 1프로익절",AtLimit,avgEntryPrice*1.01,"",Floor(MaxContracts*0.4)); ExitLong("1차매수 2프로익절",AtLimit,avgEntryPrice*1.02); } if MaxEntries == 2 and IsEntryName("1차매수",0) == true Then { ExitLong("2차매수 0.3익절",AtLimit,avgEntryPrice*1.003,"",Floor(MaxContracts*0.5)); ExitLong("2차매수 0.5익절",AtLimit,avgEntryPrice*1.005); } if MaxEntries == 1 and IsEntryName("2차매수A",0) == true Then { ExitLong("2차매수A 0.3익절",AtLimit,avgEntryPrice*1.003,"",Floor(MaxContracts*0.5)); ExitLong("2차매수A 0.5익절",AtLimit,avgEntryPrice*1.005); } ExitLong("손절",AtStop,HH*0.96); }
프로필 이미지
맴맴잉
2021-09-28
1553
글번호 152499
시스템
답변완료

이동평균

항상 감사합니다. 5)이동평균 단순이동평균/지수이동평균/가중이동평균의 차이알려주세요? *단순-간단한 조건없는 *지수- &#10647;수&#10648; 어떤 수나 문자의 오른쪽 위에 덧붙여 그 거듭제곱을 나타내는 문자나 숫자. *가중- (加重) @단어 뜻만 가지고는 이해가 어렵습니다
프로필 이미지
에리카
2021-09-27
1172
글번호 152498
지표
답변완료

BB

항상감사합니다. 볼린져 해석도와주세요 1)MultiD의 의미알려주세요 2)MAv 의 의미 알려주세요 3)Bollinger Bands 따로 함수가 있나요(찾는법 알려주세요) 3-1)Bollinger Bands의 가준은 20개의 캔들종가의 평균값인가요? 4)ma(C, Period) - (D * std(C, Period));? 해석해주세요? 5)STD(value,length) 라인가격값,기간)인가요? value=값 Length=시간의 길이 6)???Period와Length는 같은 의미인가요? 좀다른가요? 7)BollBandDown = ma(C, Period) - (D * std(C, Period)); ???이동평균종가값에서 당일의 종가값 std을 뺀 가격? ---------------------------------------------------------- 8)BollBandUp = ma(C, Period) + (D * std(C, Period)); ???이동평균종가값에서 당일의 종가값 std을 더한 가격? 4.Bollinger Bands Input : Period(20), MultiD(2); var : MAv(0),BBup(0),BBdn(0); MAv = ma(C,Period); BBup = BollBandUp(Period,MultiD); BBdn = BollBandDown(Period,MultiD); Plot1(MAv, "이평"); Plot2(BBup, "상단밴드"); Plot3(BBdn, "하단밴드"); ---------- 볼린저 밴드 20개의 캔들이다 ?MultiD(2) 멀티2개의 캔들 ?MAv=이동평균선의 볼륨or거래량? 이동평균선의 종가20개의 평균값과 멀티2개의캔들 종가 평균값이다? ?BBup=상승돌파 20개의 종가평균값을 2개의 캔들종가의 값이 돌파하는 선? ?BBdn=하방추락 20개의 종가평균값을 2개의 캔들종가의 값이 추락하는 선? Plot1(MAv, "이평"); MAv, "이평"---내부변수를 이평이라 한다 Plot1은 챠트에 가격과 라인을 표현한다. ----------------------------------------------------------- Input : Period(Numeric), D(Numeric); BollBandDown = ma(C, Period) - (D * std(C, Period)); --------------------------------------------------------------- ???이동평균종가값에서 당일의 종가값 std을 뺀 가격? Input : Period(Numeric), D(Numeric); BollBandUp = ma(C, Period) + (D * std(C, Period)); ???이동평균종가값에서 당일의 종가값 std을 더한 가격?
프로필 이미지
에리카
2021-09-27
1014
글번호 152497
지표
답변완료

수식 문의드립니다.

안녕하세요 수식 문의드립니다. <진입> 5일 최고가(혹은 최저가) 돌파시 3계약 진입 <청산> 1. 1계약 : 5포인트 상승(하락)시부터 트레일링스탑 시작. 최고가 대비 10포인트 하락시 청산 2. 1계약 : 30포인트 상승(하락)시 or 1번기준 충족시 청산 3. 1계약 : 50포인트 상승(하락)시 or 1번기준 충족시 청산 <손절> 1. 1계약 : 진입가 대비 10포인트 하락(상승)시 손절 2. 1계약 : 진입가 대비 20포인트 하락(상승)시 손절 3. 1계약 : 진입가 대비 30포인트 하락(상승)시 손절 부탁드립니다!
프로필 이미지
매력의도가니
2021-09-28
980
글번호 152496
시스템
답변완료

피봇

항상감사합니다 지표해석입니다 검토해주세요 지표-피봇분봉 Var : Pivot(0),R1(0),R2(0),S1(0),S2(0); Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; R1 = 2*Pivot-DayLow(1); R2 = Pivot+DayHigh(1)-DayLow(1); S1 = 2*Pivot-DayHigh(1); S2 = Pivot-DayHigh(1)+DayLow(1); Plot1(Pivot, "피봇포인트"); Plot2(R1, "1차저항"); Plot3(R2, "2차저항"); Plot4(S1, "1차지지"); Plot5(S2, "2차지지"); ------------------------------------- 해석 Var =내부변수?=라인 Pivot=기준은 Pivot다 R/S=라고 이름한다 Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3; 피보우트는 당일고가+저가+종가를 더한후 3으로 나눈값이다 R1 = 2*Pivot-DayLow(1); 알1은 2배의 피봇값에서 저가를 뺀 가격이다 R2 = Pivot+DayHigh(1)-DayLow(1); 알2는 피봇값에서-고저진동폭을 뺸값이다 S1 = 2*Pivot-DayHigh(1); 에스1은 2배의 피봇값에서 고점의 가격을 뺸가격이다 S2 = Pivot-DayHigh(1)+DayLow(1); 에스2는 피봇값에서 고저더한값을 뺀가격이다. Plot1(Pivot, "피봇포인트"); 선이름을 내부변수에 피봇포인트라한다 챠트에 라인으로 Plot1의 값이 표시된다. 나머지는 위와 같다.
프로필 이미지
에리카
2021-09-27
799
글번호 152495
지표

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

프로필 이미지
해피오
2021-09-27
32
글번호 152491
종목검색
답변완료

수식 부탁드립니다.

안녕하세요 매번 도움에 감사드립니다. 20일이평선 넘어가면 1계약 매수해서 30틱 올라가면 이익청산 30틱 내려오면 매도로 2계약 진입 다시 30틱 내려오면 이익청산 30틱 올라가면 4계약 매수 진입... 계속 이렇게 이익 날때까지 진입하는 수식 부탁드립니다. 수고하세요.
프로필 이미지
와시1000
2021-09-27
783
글번호 152489
시스템
답변완료

문의드립니다

ExitLong("",AtStop,Highest(H,BarsSinceEntry+1)-N) ; 2번째 진입한 피라미딩 상태에서 이렇게 추적 청산을 했을경우 BarsSinceEntry가 1번째 진입한 시점부터 계산하는것 같습니다. 2번째 진입부터 추적청산을 계산하도록 BarsSinceEntry를 두번째 진입부터 계산하도록 하는 방법이 있을까요 언제나 감사드립니다.
프로필 이미지
시고르시고르
2021-09-27
847
글번호 152480
시스템
답변완료

부탁 드립니다~~

추석 명절은 잘 보내셨나요~~^^ 그림에서 처럼 거래 대금 500억 이상 들어온 종목 중에서 (1번조건) 1번 5일선이 20일선 골든 크로스 1회 이상 나오고 2번 주가가 5일선을 2회 이상 데드 크로스 나온 후에 3번 주가가 다시 5일선 언덕 돌파 할 때 종목을 찾아 주세요. 그리고, 대금 500억 이상 인 종목에서 (2번 조건) 주가가 5이평 2회 이상 데드 나온 후, 양음양 or 양봉3개 나오면서 5이평 돌파 되는 종목을 찾고 싶습니다. 각기 다르게 조건을 만들어 주시고(1번 조건) 과 (2번 조건) 또 하나는 저 두개의 조건을 or 조건으로 하나로 만들어서 보고 싶습니다. 부탁 드릴께요~~
프로필 이미지
그리워
2021-09-27
1129
글번호 152479
종목검색