커뮤니티

예스랭귀지 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; CustomIndicator //@version=5 indicator(title="Trend Channel SwiftEdge", shorttitle="AI Trend Dashboard", overlay=true) // Inputs for Main Indicator ma_type = input.string("EMA", title="AI Moving Average Type", options=["SMA", "EMA", "WMA"]) ma_length = input.int(14, minval=3, title="AI MA Length") source = input.source(close, title="AI Data Source") show_ribbon = input.bool(true, title="Show AI Ribbon") show_background = input.bool(true, title="Show AI Background Glow") start_year = input.int(1900, title="Start Year", minval=1900, maxval=2100) end_year = input.int(2100, title="End Year", minval=1900, maxval=2100) // Input for Signal Filter Timeframe signal_tf = input.string("15", title="AI Signal Filter Timeframe", options=["1", "5", "15", "60", "240", "D"]) // Function to Calculate Trend Direction for a Given Timeframe f_calculateTrend(_src, _length, _channel_period) => ma = ma_type == "SMA" ? ta.sma(_src, _length) : ma_type == "EMA" ? ta.ema(_src, _length) : ta.wma(_src, _length) upper_channel = ta.highest(ma, _channel_period) lower_channel = ta.lowest(ma, _channel_period) trend = _src > upper_channel[1] ? 1 : _src < lower_channel[1] ? -1 : 0 trend // Calculate Moving Average (Main Indicator) ma = ma_type == "SMA" ? ta.sma(source, ma_length) : ma_type == "EMA" ? ta.ema(source, ma_length) : ta.wma(source, ma_length) // Dynamic Price Channel (Main Indicator) channel_period = ma_length * 2 upper_channel = ta.highest(ma, channel_period) lower_channel = ta.lowest(ma, channel_period) // Trend Detection (Main Indicator) var int trend_direction = 0 trend_direction := source > upper_channel[1] ? 1 : source < lower_channel[1] ? -1 : trend_direction[1] // AI-Enhanced Colors with Neon Gradient Effect neon_green = #39FF14 neon_red = #FF073A neon_blue = #00BFFF neon_gray = #808080 ribbon_color = show_ribbon ? trend_direction == 1 ? neon_green : trend_direction == -1 ? neon_red : neon_gray : na bg_color_up = show_background and trend_direction == 1 ? color.new(neon_green, 85) : na bg_color_down = show_background and trend_direction == -1 ? color.new(neon_red, 85) : na channel_color = show_ribbon ? color.new(neon_blue, 40) : na // Plotting with Holographic Effect plot_ma = plot(ma, title="AI Moving Average", color=ribbon_color, linewidth=3, style=plot.style_stepline) plot_upper = plot(upper_channel, title="AI Upper Channel", color=channel_color, linewidth=2, style=plot.style_stepline) plot_lower = plot(lower_channel, title="AI Lower Channel", color=channel_color, linewidth=2, style=plot.style_stepline) // Background Glow with Gradient fill(plot_upper, plot_lower, color=bg_color_up, title="AI Bullish Glow") fill(plot_upper, plot_lower, color=bg_color_down, title="AI Bearish Glow") // Time Filter time_valid = time >= timestamp(start_year, 1, 1, 0, 0) and time <= timestamp(end_year, 12, 31, 23, 59) // Multi-Timeframe Trend Analysis src_1m = request.security(syminfo.tickerid, "1", source) src_5m = request.security(syminfo.tickerid, "5", source) src_15m = request.security(syminfo.tickerid, "15", source) src_1h = request.security(syminfo.tickerid, "60", source) src_4h = request.security(syminfo.tickerid, "240", source) src_1d = request.security(syminfo.tickerid, "D", source) trend_1m = f_calculateTrend(src_1m, ma_length, channel_period) trend_5m = f_calculateTrend(src_5m, ma_length, channel_period) trend_15m = f_calculateTrend(src_15m, ma_length, channel_period) trend_1h = f_calculateTrend(src_1h, ma_length, channel_period) trend_4h = f_calculateTrend(src_4h, ma_length, channel_period) trend_1d = f_calculateTrend(src_1d, ma_length, channel_period) // AI-Enhanced Dashboard var table trend_table = table.new(position.top_right, 2, 8, border_width=2, border_color=neon_blue, bgcolor=color.new(color.black, 80)) if barstate.islastconfirmedhistory table.cell(trend_table, 0, 0, "AI Trend", bgcolor=color.new(neon_blue, 60), text_color=color.white, text_size=size.normal) table.cell(trend_table, 1, 0, "Analysis", bgcolor=color.new(neon_blue, 60), text_color=color.white, text_size=size.normal) table.cell(trend_table, 0, 1, "Timeframe", bgcolor=color.new(color.gray, 80), text_color=neon_blue) table.cell(trend_table, 1, 1, "Trend", bgcolor=color.new(color.gray, 80), text_color=neon_blue) table.cell(trend_table, 0, 2, "1 Min", bgcolor=color.new(color.black, 90), text_color=neon_blue) table.cell(trend_table, 1, 2, trend_1m == 1 ? "UP" : trend_1m == -1 ? "DOWN" : "NEUTRAL", bgcolor=trend_1m == 1 ? color.new(neon_green, 60) : trend_1m == -1 ? color.new(neon_red, 60) : color.new(neon_gray, 60), text_color=color.white) table.cell(trend_table, 0, 3, "5 Min", bgcolor=color.new(color.black, 90), text_color=neon_blue) table.cell(trend_table, 1, 3, trend_5m == 1 ? "UP" : trend_5m == -1 ? "DOWN" : "NEUTRAL", bgcolor=trend_5m == 1 ? color.new(neon_green, 60) : trend_5m == -1 ? color.new(neon_red, 60) : color.new(neon_gray, 60), text_color=color.white) table.cell(trend_table, 0, 4, "15 Min", bgcolor=color.new(color.black, 90), text_color=neon_blue) table.cell(trend_table, 1, 4, trend_15m == 1 ? "UP" : trend_15m == -1 ? "DOWN" : "NEUTRAL", bgcolor=trend_15m == 1 ? color.new(neon_green, 60) : trend_15m == -1 ? color.new(neon_red, 60) : color.new(neon_gray, 60), text_color=color.white) table.cell(trend_table, 0, 5, "1 Hour", bgcolor=color.new(color.black, 90), text_color=neon_blue) table.cell(trend_table, 1, 5, trend_1h == 1 ? "UP" : trend_1h == -1 ? "DOWN" : "NEUTRAL", bgcolor=trend_1h == 1 ? color.new(neon_green, 60) : trend_1h == -1 ? color.new(neon_red, 60) : color.new(neon_gray, 60), text_color=color.white) table.cell(trend_table, 0, 6, "4 Hour", bgcolor=color.new(color.black, 90), text_color=neon_blue) table.cell(trend_table, 1, 6, trend_4h == 1 ? "UP" : trend_4h == -1 ? "DOWN" : "NEUTRAL", bgcolor=trend_4h == 1 ? color.new(neon_green, 60) : trend_4h == -1 ? color.new(neon_red, 60) : color.new(neon_gray, 60), text_color=color.white) table.cell(trend_table, 0, 7, "1 Day", bgcolor=color.new(color.black, 90), text_color=neon_blue) table.cell(trend_table, 1, 7, trend_1d == 1 ? "UP" : trend_1d == -1 ? "DOWN" : "NEUTRAL", bgcolor=trend_1d == 1 ? color.new(neon_green, 60) : trend_1d == -1 ? color.new(neon_red, 60) : color.new(neon_gray, 60), text_color=color.white) // Signal Filter Trend signal_trend = request.security(syminfo.tickerid, signal_tf, f_calculateTrend(source, ma_length, channel_period)) // Check Higher Timeframes for Trend Direction bool higher_tf_up = false bool higher_tf_down = false if signal_tf == "1" higher_tf_up := trend_5m == 1 and trend_15m == 1 and trend_1h == 1 and trend_4h == 1 higher_tf_down := trend_5m == -1 and trend_15m == -1 and trend_1h == -1 and trend_4h == -1 else if signal_tf == "5" higher_tf_up := trend_15m == 1 and trend_1h == 1 and trend_4h == 1 higher_tf_down := trend_15m == -1 and trend_1h == -1 and trend_4h == -1 else if signal_tf == "15" higher_tf_up := trend_1h == 1 and trend_4h == 1 higher_tf_down := trend_1h == -1 and trend_4h == -1 else if signal_tf == "60" higher_tf_up := trend_4h == 1 and trend_1d == 1 higher_tf_down := trend_4h == -1 and trend_1d == -1 else if signal_tf == "240" higher_tf_up := trend_1d == 1 higher_tf_down := trend_1d == -1 else if signal_tf == "D" higher_tf_up := true // No higher timeframe to check higher_tf_down := true // Buy and Sell Signals based on Trend Cross in Signal Filter Timeframe, Main Trend, and Higher Timeframes buy_signal = ta.crossover(signal_trend, 0) and trend_direction == 1 and (signal_trend == 1 or (signal_trend == 0 and higher_tf_up)) and time_valid sell_signal = ta.crossunder(signal_trend, 0) and trend_direction == -1 and (signal_trend == -1 or (signal_trend == 0 and higher_tf_down)) and time_valid // AI-Enhanced Buy and Sell Signals with Futuristic Labels if buy_signal label.new(bar_index, low, "&#128640; AI BUY", color=neon_green, style=label.style_label_up, textcolor=color.white, size=size.normal) if sell_signal label.new(bar_index, high, "&#128721; AI SELL", color=neon_red, style=label.style_label_down, textcolor=color.white, size=size.normal)
프로필 이미지
파생돌이
102
글번호 194525
지표
답변완료

수식문의(배열)

1.정배열 시 1봉전에는 NOT 정배열 1봉전 종가와 200EMA 이격(1봉전 종가>200EMA); 30%이하 0봉전에 200EMA<TEWMA<LRL(50)의 정배열이 되는 종목 (full 정배열되는 날 검색) 또는 2.역배열 시 6봉전 이내 LRL이 TEWMA 상향돌파 후 0봉전 종가와 200EMA 이격(0봉전 종가>200EMA); 20%이하 0봉전에 LRL이 200EMA 상향돌파하는 종목 (LRL이 TEWMA돌파 후 6봉이내 200EMA를 돌파할 시 검색: not full 정배열) 을 검색하는 수식을 문의드립니다. 참고로 TEWMA 수식은 wma1 = wavg(C, len); // TEMA 계산 ema1_1 = eavg(wma1, len); ema1_2 = eavg(ema1_1, len); ema1_3 = eavg(ema1_2, len); TEWMA1 = 3 * ema1_1 - 3 * ema1_2 + ema1_3; len2 = len * multi; wma2 = wavg(C, len2); ema2_1 = eavg(wma2, len2); ema2_2 = eavg(ema2_1, len2); ema2_3 = eavg(ema2_2, len2); TEWMA2 = 3 * ema2_1 - 3 * ema2_2 + ema2_3; TEWMA = (TEWMA1 + TEWMA2) / 2;
프로필 이미지
ksks
57
글번호 194524
종목검색
답변완료

종목검색식 부탁드려요

5일선과 20일선이 골든크로스하는데 직전 크로스업보다 높은 위치에서 크로스업하는 종목을 찾는 종목검색식을 부탁합니다. ②번과 같은 자리를 찾는 것입니다.
프로필 이미지
고도산
106
글번호 194523
종목검색
답변완료

지표작성부탁드립니다

사용지표 : 1.이동평균선(5) 2.붙임 지표 지표식 : 붙임2지표의 상단선이 이평선(5)위에 있으면 지표바탕에 노란색으로 표시되는 지표식 부탁합니다 붙임 : 2 지표 input : period(10),multiplier(3); var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0); var : prevSuperTrend(0), direction(0),alpha(0),source(0),SuperTrend(C); if CurrentBar > 1 Then { src = (H+L)/2; alpha = 1 / period ; source = max(high - low, abs(high - close[1]), abs(low - close[1])); ATrV = alpha * source + (1 - alpha) * ATrV[1]; //지수가중이평방식 //ATrV = ma(source,AtrPeriod); //단순이평방식 upperBand = src + multiplier * AtrV; lowerBand = src - multiplier * AtrV; prevLowerBand = lowerBand[1]; prevUpperBand = upperBand[1]; if lowerBand > prevLowerBand or close[1] < prevLowerBand Then lowerBand = lowerBand; Else lowerBand = prevLowerBand; if upperBand < prevUpperBand or close[1] > prevUpperBand Then upperBand = upperBand; Else upperBand = prevUpperBand; if C > UpperBand Then direction = 1; if C < LowerBand Then direction = -1; if direction == 1 Then SuperTrend = lowerband; Else SuperTrend = upperband; Plot1(SuperTrend,"SuperTrend",IFF(direction==1,Red,Blue)); }
프로필 이미지
파워
56
글번호 194522
지표
답변완료

VWAP로 종목 검색구현

거래량가중 이동평균 VWAP입니다 AA=(H+L+C)/3; BB=AA*V; X1=SUM(BB); X2=SUM(V); X1/X2 해당 지표로 돌파와 돌파후 눌릴때 종목 검색이 가능할까요?
프로필 이미지
빅토리아75
49
글번호 194521
검색
답변완료

수식문의(LRL50)

LRL(C,50)=L이라 하면 조건1)200EMA가 상승추세(200EMA값이 2봉이상 상승: 2봉전<1봉전<0봉전)에서 조건2)L(20)>L*1.2 (20봉전의 L값(not 주가)이 현재봉의 L값보다 20%이상 크다) 일 경우, L의 상승변곡(L(3)>L(2)>L(1)<L(0))이 발생한 종목을 검색코자 수식문의 드립니다.
프로필 이미지
ksks
49
글번호 194519
종목검색
답변완료

수식추가부탁드립다.

아래 수식에 ---->> && 상향지속 == N then Find(1); 을 변환 부탁드립니다. 1> 상향지속 N (*이상) 2> 상향지속 N (*3봉연속발생) ----아래 ------- input : Period(10),rate(5),K(5),N(5); var : MG(0),E(0); var : 하향지속(0),상향지속(0); MG = Ema(C,Period)[1]+((C-(Ema(C,Period)[1]) ) / (C/(Ema(C,Period)[1]) *rate)); E=Ema(C,Period)[1]; 하향지속=CountIf(MG < E,K); 상향지속=CountIf(MG > E,N); if 하향지속[N] == K && 상향지속 == N then //// 추가 상향지속 N (*이상)으로 Find(1);
프로필 이미지
깨구리
51
글번호 194518
종목검색
답변완료

부탁드립니다 항상 감사합니다

// Impulse-MACD (ZLEMA-like mid) - 안정화 버전 input : lengthMA(34), lengthSignal(9); var : src(0), hi(0), lo(0), ema1(0), ema2(0), mi(0); var : md(0), sb(0), sh(0), mdc(0); // Typical price src = (H + L + C) / 3; // 상/하단 밴드: 첫 바 안정화 hi = IFF(IsNaN(hi[1]) = true, MA(High, lengthMA), (hi[1] * (lengthMA - 1) + High) / lengthMA); lo = IFF(IsNaN(lo[1]) = true, MA(Low , lengthMA), (lo[1] * (lengthMA - 1) + Low ) / lengthMA); // ZLEMA-like mid ema1 = EMA(src, lengthMA); ema2 = EMA(ema1, lengthMA); mi = ema1 + (ema1 - ema2); // 밴드 돌출량(안이면 0) md = IFF(mi > hi, mi - hi, IFF(mi < lo, mi - lo, 0)); // 시그널/히스토그램 sb = MA(md, lengthSignal); sh = md - sb; // 색상 결정 (막대 색상: 속성에서 '막대' 선택 권장) // lime/green : 위쪽 강세, orange/red : 하단/약세 mdc = IFF(src > mi, IFF(src > hi, lime, green), IFF(src < lo, red, orange)); // === Plot === Plot1(0, "MidLine", Gray); // 0선 Plot2(md, "ImpulseMACD", mdc); // 본체(막대로 표시) Plot3(sh, "ImpulseHisto", Blue); // 히스토그램(막대로 표시) Plot4(sb, "ImpulseSignal", Maroon); // 시그널 보완부탁드립니다
프로필 이미지
윤호석
57
글번호 194517
지표
답변완료

종목검색식 부탁드림니다.

즐거운 명절 보내셨는지요? 항상 노고에 감사드림니다. 아래의 수식을 종목검색식으로 부탁드림니다. A=avg(C,Period)-avg(C,기간)*비율/100; A1=sum(if(C-C(1)>0,C-C(1),0),Period)/sum(if(C-C(1)>0,C-C(1),C(1)-C),Period)*100; A2=eavg(if(L(1)-L>0 && H-H(1)<L(1)-L,L(1)-L,0),Period)/eavg(max(max(H-L,abs(C(1)-H)),abs(C(1)-L)),Period)*100; (L(1)<=A(1) or L<=A) && (A1(1)<=30 or A1 <=30) && (A2(1)>30 or A2>30) && C>O 지표변수 기간 20 비율 20 Period 14
프로필 이미지
존슨비치
46
글번호 194516
종목검색
답변완료

부탁드립니다 항상 감사합니다

일전에 작성해주신건데 해외선물 차트에 구현되는게 하나도없어서요.. 다시한번 부탁드리겠습니다 안녕하세요 예스스탁입니다. 1 // === 사용자 입력 === Input : 기준거래량배율(1.5), 체결강도EMA(20), OI_EMA단기(10), OI_EMA장기(60); // === 변수 선언 === Var: 매수체결량(0), 매도체결량(0), 순매수체결량(0), 순매도체결량(0), 순체결강도(0), 체결EMA(0); Var: OI변화(0), 누적OI(0), OI_EMA1(0), OI_EMA2(0); Var: 기준거래량(0), 거래량필터패스(False), tx(0); // === 거래량 필터 === 기준거래량 = Average(Volume, 20); #If Volume < 기준거래량 * 기준거래량배율 Then Return; // === 체결강도 계산 === 매수체결량 = IFF(Close > Close[1], Volume, 0); 매도체결량 = IFF(Close < Close[1], Volume, 0); 순매수체결량 = ACCUM(매수체결량); 순매도체결량 = ACCUM(매도체결량); 순체결강도 = ACCUM(매수체결량 - 매도체결량); // === 체결강도 EMA === 체결EMA = EMA(순체결강도, 체결강도EMA); // === 체결강도 급증 알림 === If CrossUp(순체결강도, 체결EMA) Then Begin tx = Text_New_Self(Date, Time, Close, "체결강도↑"); Text_SetColor(tx, Red); Text_SetStyle(tx, 2, 0); End; // === OI 변화 누적 및 이동평균 === OI변화 = OI - OI[1]; 누적OI = ACCUMN(OI변화, DayIndex()); OI_EMA1 = EMA(누적OI, OI_EMA단기); OI_EMA2 = EMA(누적OI, OI_EMA장기); // === OI 교차 알림 === If CrossUp(OI_EMA1, OI_EMA2) Then Begin tx = Text_New_Self(Date, Time, Close, "OI↑"); Text_SetColor(tx, Green); End; If CrossDown(OI_EMA1, OI_EMA2) Then Begin tx = Text_New_Self(Date, Time, Close, "OI↓"); Text_SetColor(tx, Blue); End; // === 차트 출력 === Plot1(순매수체결량, "순매수"); Plot2(순매도체결량, "순매도"); Plot3(순체결강도, "순체결강도"); Plot4(체결EMA, "체결EMA"); Plot5(누적OI, "누적OI"); Plot6(OI_EMA1, "OI EMA10"); Plot7(OI_EMA2, "OI EMA60"); PlotBaseLine1(0); 2 // =================== 입력값 =================== Input: 기준거래량배율(1.5), 체결EMA기간(20), OI_EMA단기(10), OI_EMA장기(60), 익절률(1.02), 손절률(0.985), 박스색(RGB(220,220,220)); // =================== 변수 =================== Var: 매수체결량(0), 매도체결량(0), 순체결강도(0), 체결EMA(0); Var: OI변화(0), 누적OI(0), OI_EMA1(0), OI_EMA2(0); Var: 기준거래량(0), 진입가(0), 익절가(0), 손절가(0), 진입중(False), 박스ID(0); // =================== 거래량 필터 =================== 기준거래량 = Average(Volume, 20); #If Volume < 기준거래량 * 기준거래량배율 Then Return; // =================== 체결강도 =================== 매수체결량 = IFF(Close > Close[1], Volume, 0); 매도체결량 = IFF(Close < Close[1], Volume, 0); 순체결강도 = ACCUM(매수체결량 - 매도체결량); 체결EMA = EMA(순체결강도, 체결EMA기간); // =================== OI 누적 및 이동평균 =================== OI변화 = OI - OI[1]; 누적OI = ACCUMN(OI변화, DayIndex()); OI_EMA1 = EMA(누적OI, OI_EMA단기); OI_EMA2 = EMA(누적OI, OI_EMA장기); // =================== 진입 조건 =================== If 진입중 == False AND 순체결강도 > 체결EMA AND CrossUp(OI_EMA1, OI_EMA2) Then Begin 진입가 = Close; 익절가 = 진입가 * 익절률; 손절가 = 진입가 * 손절률; 진입중 = True; // 박스 출력 박스ID = Box_New(Date, Time, 익절가, NextBarSdate, NextBarStime, 손절가); Box_SetColor(박스ID, 박스색); Box_SetStyle(박스ID, 1); Box_SetSize(박스ID, 2); // 진입 텍스트 Text_New(Date, Time, Close, "진입 ▶"); End; // =================== 청산 조건 =================== If 진입중 Then Begin Box_SetEnd(박스ID,NextBarSdate,NextBarStime,손절가); If Close >= 익절가 Then Begin Text_New(Date, Time, Close, "익절"); 진입중 = False; End Else If Close <= 손절가 Then Begin Text_New(Date, Time, Close, "손절"); 진입중 = False; End; End; 3 // =================== 입력값 =================== Input: 기준거래량배율(1.5), 체결EMA기간(20), OI_EMA단기(10), OI_EMA장기(60), 익절률(1.02), 손절률(0.985), 숏익절률(0.98), 숏손절률(1.015), 박스색_롱(RGB(220,220,220)), 박스색_숏(RGB(200,230,255)); // =================== 변수 =================== Var: 매수체결량(0), 매도체결량(0), 순체결강도(0), 체결EMA(0); Var: OI변화(0), 누적OI(0), OI_EMA1(0), OI_EMA2(0); Var: 기준거래량(0), 진입가(0), 익절가(0), 손절가(0), 진입중(False), 숏진입(False); Var: 박스ID(0); // =================== 거래량 필터 =================== 기준거래량 = Average(Volume, 20); #If Volume < 기준거래량 * 기준거래량배율 Then Return; // =================== 체결강도 계산 =================== 매수체결량 = IFF(Close > Close[1], Volume, 0); 매도체결량 = IFF(Close < Close[1], Volume, 0); 순체결강도 = ACCUM(매수체결량 - 매도체결량); 체결EMA = EMA(순체결강도, 체결EMA기간); // =================== OI 이동평균 =================== OI변화 = OI - OI[1]; 누적OI = ACCUMN(OI변화, DayIndex()); OI_EMA1 = EMA(누적OI, OI_EMA단기); OI_EMA2 = EMA(누적OI, OI_EMA장기); // =================== 롱 진입 =================== If 진입중 == False AND 순체결강도 > 체결EMA AND CrossUp(OI_EMA1, OI_EMA2) Then Begin 진입가 = Close; 익절가 = 진입가 * 익절률; 손절가 = 진입가 * 손절률; 진입중 = True; 숏진입 = False; 박스ID = Box_New(Date, Time, 익절가, NextBarSdate, NextBarStime, 손절가); Box_SetColor(박스ID, 박스색_롱); Box_SetStyle(박스ID, 1); Box_SetSize(박스ID, 2); Text_New(Date, Time, Close, "롱 진입 ▶"); End; // =================== 숏 진입 =================== If 진입중 == False AND 순체결강도 < 체결EMA AND CrossDown(OI_EMA1, OI_EMA2) Then Begin 진입가 = Close; 익절가 = 진입가 * 숏익절률; 손절가 = 진입가 * 숏손절률; 진입중 = True; 숏진입 = True; 박스ID = Box_New(Date, Time, 익절가, NextBarSdate, NextBarStime, 손절가); Box_SetColor(박스ID, 박스색_숏); Box_SetStyle(박스ID, 1); Box_SetSize(박스ID, 2); Text_New(Date, Time, Close, "숏 진입 ▼"); End; // =================== 청산 조건 =================== If 진입중 Then Begin Box_SetEnd(박스ID,NextBarSdate,NextBarStime,손절가); If 숏진입 == False Then // 롱 Begin If Close >= 익절가 Then Begin Text_New(Date, Time, Close, "롱 익절 &#9989;"); 진입중 = False; End Else If Close <= 손절가 Then Begin Text_New(Date, Time, Close, "롱 손절 &#10060;"); 진입중 = False; End; End Else // 숏 Begin If Close <= 익절가 Then Begin Text_New(Date, Time, Close, "숏 익절 &#9989;"); 진입중 = False; End Else If Close >= 손절가 Then Begin Text_New(Date, Time, Close, "숏 손절 &#10060;"); 진입중 = False; End; End; End; 4 Input: 진입가(350), 손절비율(0.985), 익절비율(1.015), 박스색상(Green), 손절색상(Red); // 진입, 손절, 익절가 계산 Var: 익절가(0), 손절가(0), 손익비(0); 익절가 = 진입가 * 익절비율; 손절가 = 진입가 * 손절비율; 손익비 = Round((익절가 - 진입가) / (진입가 - 손절가), 2); // 박스 출력 (익절) Var: 익절박스(0); // 박스 출력 (손절) Var: 손절박스(0); // 텍스트 출력: 손익비 Var: tx(0); if Index == 1 Then { 익절박스 = Box_New(Date, Time, 진입가, NextBarSdate, NextBarStime, 익절가); Box_SetColor(익절박스, 박스색상); Box_SetFill(익절박스, true); 손절박스 = Box_New(Date, Time, 손절가, NextBarSdate, NextBarStime, 진입가); Box_SetColor(손절박스, 손절색상); Box_SetFill(손절박스, true); tx = Text_New(Date, Time, 손절가 - (진입가 - 손절가)/2, "손익비: " + NumToStr(손익비, 2)); Text_SetStyle(tx, 1, 0); Text_SetColor(tx, Black); Text_SetSize(tx, 10); } Else { Box_SetEnd(익절박스,NextBarSdate,NextBarStime,익절가); Box_SetEnd(손절박스,NextBarSdate,NextBarStime,익절가); Text_SetLocation(tx,NextBarSdate,NextBarStime, 손절가 - (진입가 - 손절가)/2); } 5 Input: 진입가(0), 손절비율(1.015), 익절비율(0.985), 박스색상(Red), 손절색상(Green); // === 익절/손절가 계산 === Var: 익절가(0), 손절가(0), 손익비(0); 익절가 = 진입가 * 익절비율; 손절가 = 진입가 * 손절비율; 손익비 = Round((진입가 - 익절가) / (손절가 - 진입가), 2); // === 익절 박스 생성 === Var: 익절박스(0); // === 손절 박스 생성 === Var: 손절박스(0); // === 손익비 텍스트 출력 === Var: tx(0); if Index == 1 Then { 익절박스 = Box_New(Date, Time, 익절가, NextBarSdate, NextBarStime, 진입가); Box_SetColor(익절박스, 박스색상); Box_SetFill(익절박스, true); 손절박스 = Box_New(Date, Time, 진입가, NextBarSdate, NextBarStime, 손절가); Box_SetColor(손절박스, 손절색상); Box_SetFill(손절박스, true); tx = Text_New(Date, Time, 손절가 + (손절가 - 진입가)/2, "손익비: " + NumToStr(손익비, 2)); Text_SetStyle(tx, 1, 1); Text_SetColor(tx, Black); Text_SetSize(tx, 10); } Else { Box_SetEnd(익절박스,NextBarSdate,NextBarStime,진입가); Box_SetEnd(손절박스,NextBarSdate,NextBarStime,손절가); Text_SetLocation(tx,NextBarSdate,NextBarStime,손절가 + (손절가 - 진입가)/2); }
프로필 이미지
윤호석
68
글번호 194515
지표