커뮤니티
예스랭귀지 Q&A
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1395
글번호 230811
답변완료
수식 작성 부탁드립니다
data2 의 챠트 신호 발생시 (data2 챠트상 Crossup(c , superTrend) 신호 발생시)
data1에서 매수진입.
data2 Crossdown(c , superTrend) 신호 발생시)
data1에서 매수청산 되도록 수식 작성 부탁드립니다.
data1(개별종목), data2(종합지수) 모두 1분 챠트 사용합니다
타주기는 1분챠트에서 5분 챠트 주기의 data2 - Crossup(c , superTrend) data1 - 매수진입,
Crossdown(c , superTrend) data1 - 매수 청산 되도록 원합니다.
매매 시간은
매수 진입 가능 시간 - 오전 9시 5분에 매매시작 15시(오후 3시) 까지 매수 진입 가능,
매수청산 가능 시간 - 오전9시 5분부터 15시 15분까지 매수청산 가능.
15시 이전에 매수 진입한 포지션이 매수 청산, Crossdown(c , superTrend) 15시 15분 까지
신호발생 되지 않으면 15시 15분에 매수청산 즉 당일 청산이 이루어 지도록 수식 원합니다.
input : starttime(90500),endtime(150000),XTime(151500);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
}
if Tcond == true then
{
// 타주기 1분챠트 5분 주기 표시
input : ntime(5),factor(3), AtrPeriod(10);
var : S1(0),D1(0),TM(0),TF(0),HH(0),LL(0),C1(0);
var : src(0), AtrV(0),ATRv1(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), superTrend(0), direction(0),alpha(0),source(0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
HH = H;
LL = L;
C1 = C[1];
ATRV1 = ATRV[1];
prevSuperTrend = superTrend[1];
prevLowerBand = lowerBand[1];
prevUpperBand = upperBand[1];
}
if H > HH Then
HH = H;
if L < LL Then
LL = L;
src = (HH+LL)/2;
if C1 > 0 Then
{
alpha = 1 / AtrPeriod ;
source = max(HH - LL, abs(HH - C1), abs(LL - C1));
ATrV = alpha * source + (1 - alpha) * ATrV1;
upperBand = src + factor * AtrV;
lowerBand = src - factor * AtrV;
if lowerBand > prevLowerBand or C1 < prevLowerBand Then
lowerBand = lowerBand;
Else
lowerBand = prevLowerBand;
if upperBand < prevUpperBand or C1 > prevUpperBand Then
upperBand = upperBand;
Else
upperBand = prevUpperBand;
if prevSuperTrend == prevUpperBand Then
{
if C > upperBand Then
direction = -1;
Else
direction = 1;
}
Else
{
if C < lowerBand Then
direction = 1;
Else
direction = -1;
}
if direction == -1 Then
superTrend = lowerBand;
Else
superTrend = upperBand;
}
}
// data2 의 챠트 신호 발생시 data1에서 매수진입. 매수청산.
if data2(crossup(C,superTrend)) then
buy();
if data2(crossdown(C,superTrend)) then
exitlong();
}
SetStopEndofday(XTime);
2024-07-04
728
글번호 181227
답변완료
조건검색식 문의드립니다.
지표 검색을 하고 싶어요 ㅠㅠ
파란색 동그라미 체크 된 buy 신호는 supertrend EXPLORER/SCREENER 지표에서 나온 신호인데
지표설정은
1. ART Period : 14
2. ART Multiplier : 4
5분봉에서 활용중에 있는데 제가 찾을 때쯤으면 이미 올라가있고 종목을 찾는데 시간이 너무 걸림니다.ㅠㅠ 해당 조건검색식 좀 도와주셨으면 하고 부탁드립니다.
지표 소스코드가 이렇게 생성되어있는데 어떻게 해야할지 모르겠습니다....
/ This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © KivancOzbilgic
//derived the screener logic from @ zzzcrypto123
//@version=4
study("Supertrend Explorer", shorttitle="StEx", overlay=true)
Periods = input(title="ATR Period", type=input.integer, defval=10)
src = input(hl2, title="Source")
Multiplier = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3.0)
changeATR= input(title="Change ATR Calculation Method ?", type=input.bool, defval=true)
showsignals = input(title="Show Buy/Sell Signals ?", type=input.bool, defval=true)
highlighting = input(title="Highlighter On/Off ?", type=input.bool, defval=true)
t1 = input('BINANCE:BTCUSDT', title=input.symbol)
t2 = input('BINANCE:ADABTC', title=input.symbol)
t3 = input('BINANCE:BCHBTC', title=input.symbol)
t4 = input('BINANCE:EOSBTC', title=input.symbol)
t5 = input('BINANCE:ETHBTC', title=input.symbol)
t6 = input('BINANCE:LTCBTC', title=input.symbol)
t7 = input('BINANCE:TRXBTC', title=input.symbol)
t8 = input('BINANCE:XRPBTC', title=input.symbol)
t9 = input('BINANCE:LINKBTC', title=input.symbol)
t10 = input('XBTUSD', title=input.symbol)
t11 = input('AAPL', title=input.symbol)
t12 = input('MSFT', title=input.symbol)
t13 = input('AMZN', title=input.symbol)
t14 = input('TSLA', title=input.symbol)
t15 = input('NFLX', title=input.symbol)
t16 = input('GOOGL', title=input.symbol)
t17 = input('EURUSD', title=input.symbol)
t18 = input('GBPUSD', title=input.symbol)
t19 = input('USDJPY', title=input.symbol)
t20 = input('XAUUSD', title=input.symbol)
t21 = input('DXY', title=input.symbol)
t22 = input('NIFTY', title=input.symbol)
t23 = input('GOLD', title=input.symbol)
t24 = input('UKOIL', title=input.symbol)
t25 = input('BIST:ASELS', title=input.symbol)
t26 = input('BIST:AKBNK', title=input.symbol)
t27 = input('BIST:HALKB', title=input.symbol)
t28 = input(title="Ticker28", title=input.symbol, defval="BIST:KRDMD" )
t29 = input(title="Ticker29", title=input.symbol, defval="BIST:SISE" )
t30 = input(title="Ticker30", title=input.symbol, defval="BIST:TTKOM" )
t31 = input(title="Ticker31", title=input.symbol, defval="BIST:VAKBN" )
t32 = input(title="Ticker32", title=input.symbol, defval="BIST:YKBNK" )
t33 = input(title="Ticker33", title=input.symbol, defval="BIST:KOZAL" )
t34 = input(title="Ticker34", title=input.symbol, defval="BIST:PGSUS" )
t35 = input(title="Ticker35", title=input.symbol, defval="BIST:PETKM" )
t36 = input(title="Ticker36", title=input.symbol, defval="BIST:TUPRS" )
t37 = input(title="Ticker37", title=input.symbol, defval="BIST:GARAN" )
t38 = input(title="Ticker38", title=input.symbol, defval="BIST:THYAO" )
atr2 = sma(tr, Periods)
atr= changeATR ? atr(Periods) : atr2
up=src-(Multiplier*atr)
up1 = nz(up[1],up)
up := close[1] > up1 ? max(up,up1) : up
dn=src+(Multiplier*atr)
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green)
buySignal = trend == 1 and trend[1] == -1
plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green, transp=0)
plotshape(buySignal and showsignals ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)
dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red)
sellSignal = trend == -1 and trend[1] == 1
plotshape(sellSignal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red, transp=0)
plotshape(sellSignal and showsignals ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)
longFillColor = highlighting ? (trend == 1 ? color.green : color.white) : color.white
shortFillColor = highlighting ? (trend == -1 ? color.red : color.white) : color.white
fill(mPlot, upPlot, title="UpTrend Highligter", color=longFillColor)
fill(mPlot, dnPlot, title="DownTrend Highligter", color=shortFillColor)
alertcondition(buySignal, title="SuperTrend Buy", message="SuperTrend Buy!")
alertcondition(sellSignal, title="SuperTrend Sell", message="SuperTrend Sell!")
changeCond = trend != trend[1]
alertcondition(changeCond, title="SuperTrend Direction Change", message="SuperTrend has changed direction!")
showscr = input(true, title="Show Screener Label")
posX_scr = input(20, title="Pos. Label x-axis")
posY_scr = input(1, title="Pos. Size Label y-axis")
colinput = input(title="Label Color", defval="Blue", options=["White", "Black", "Red", "Green", "Yellow", "Blue"])
col = color.gray
if colinput=="White"
col:=color.white
if colinput=="Black"
col:=color.black
if colinput=="Red"
col:=color.red
if colinput=="Green"
col:=color.green
if colinput=="Yellow"
col:=color.yellow
if colinput=="Blue"
col:=color.blue
Supertrend(Multiplier, Periods) =>
Up=hl2-(Multiplier*atr)
Dn=hl2+(Multiplier*atr)
TrendUp = 0.0
TrendUp := close[1]>TrendUp[1] ? max(Up,TrendUp[1]) : Up
TrendDown = 0.0
TrendDown := close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn
Trend = 0.0
Trend := close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],1)
Tsl = Trend==1? TrendUp: TrendDown
S_Buy = Trend == 1 ? 1 : 0
S_Sell = Trend != 1 ? 1 : 0
[Trend, Tsl]
[Trend, Tsl] = Supertrend(Multiplier, Periods)
TrendReversal = Trend != Trend[1]
[t01, s01] = security(t1, timeframe.period, Supertrend(Multiplier, Periods))
[t02, s02] = security(t2, timeframe.period, Supertrend(Multiplier, Periods))
[t03, s03] = security(t3, timeframe.period, Supertrend(Multiplier, Periods))
[t04, s04] = security(t4, timeframe.period, Supertrend(Multiplier, Periods))
[t05, s05] = security(t5, timeframe.period, Supertrend(Multiplier, Periods))
[t06, s06] = security(t6, timeframe.period, Supertrend(Multiplier, Periods))
[t07, s07] = security(t7, timeframe.period, Supertrend(Multiplier, Periods))
[t08, s08] = security(t8, timeframe.period, Supertrend(Multiplier, Periods))
[t09, s09] = security(t9, timeframe.period, Supertrend(Multiplier, Periods))
[t010, s010] = security(t10, timeframe.period, Supertrend(Multiplier, Periods))
[t011, s011] = security(t11, timeframe.period, Supertrend(Multiplier, Periods))
[t012, s012] = security(t12, timeframe.period, Supertrend(Multiplier, Periods))
[t013, s013] = security(t13, timeframe.period, Supertrend(Multiplier, Periods))
[t014, s014] = security(t14, timeframe.period, Supertrend(Multiplier, Periods))
[t015, s015] = security(t15, timeframe.period, Supertrend(Multiplier, Periods))
[t016, s016] = security(t16, timeframe.period, Supertrend(Multiplier, Periods))
[t017, s017] = security(t17, timeframe.period, Supertrend(Multiplier, Periods))
[t018, s018] = security(t18, timeframe.period, Supertrend(Multiplier, Periods))
[t019, s019] = security(t19, timeframe.period, Supertrend(Multiplier, Periods))
[t020, s020] = security(t20, timeframe.period, Supertrend(Multiplier, Periods))
[t021, s021] = security(t21, timeframe.period, Supertrend(Multiplier, Periods))
[t022, s022] = security(t22, timeframe.period, Supertrend(Multiplier, Periods))
[t023, s023] = security(t23, timeframe.period, Supertrend(Multiplier, Periods))
[t024, s024] = security(t24, timeframe.period, Supertrend(Multiplier, Periods))
[t025, s025] = security(t25, timeframe.period, Supertrend(Multiplier, Periods))
[t026, s026] = security(t26, timeframe.period, Supertrend(Multiplier, Periods))
[t027, s027] = security(t27, timeframe.period, Supertrend(Multiplier, Periods))
[t028, s028] = security(t28, timeframe.period, Supertrend(Multiplier, Periods))
[t029, s029] = security(t29, timeframe.period, Supertrend(Multiplier, Periods))
[t030, s030] = security(t30, timeframe.period, Supertrend(Multiplier, Periods))
[t031, s031] = security(t31, timeframe.period, Supertrend(Multiplier, Periods))
[t032, s032] = security(t32, timeframe.period, Supertrend(Multiplier, Periods))
[t033, s033] = security(t33, timeframe.period, Supertrend(Multiplier, Periods))
[t034, s034] = security(t34, timeframe.period, Supertrend(Multiplier, Periods))
[t035, s035] = security(t35, timeframe.period, Supertrend(Multiplier, Periods))
[t036, s036] = security(t36, timeframe.period, Supertrend(Multiplier, Periods))
[t037, s037] = security(t37, timeframe.period, Supertrend(Multiplier, Periods))
[t038, s038] = security(t38, timeframe.period, Supertrend(Multiplier, Periods))
tr01 = t01 != t01[1], up01 = t01 == 1, dn01 = t01 == -1
tr02 = t02 != t02[1], up02 = t02 == 1, dn02 = t02 == -1
tr03 = t03 != t03[1], up03 = t03 == 1, dn03 = t03 == -1
tr04 = t04 != t04[1], up04 = t04 == 1, dn04 = t04 == -1
tr05 = t05 != t05[1], up05 = t05 == 1, dn05 = t05 == -1
tr06 = t06 != t06[1], up06 = t06 == 1, dn06 = t06 == -1
tr07 = t07 != t07[1], up07 = t07 == 1, dn07 = t07 == -1
tr08 = t08 != t08[1], up08 = t08 == 1, dn08 = t08 == -1
tr09 = t09 != t09[1], up09 = t09 == 1, dn09 = t09 == -1
tr010 = t010 != t010[1], up010 = t010 == 1, dn010 = t010 == -1
tr011 = t011 != t011[1], up011 = t011 == 1, dn011 = t011 == -1
tr012 = t012 != t012[1], up012 = t012 == 1, dn012 = t012 == -1
tr013 = t013 != t013[1], up013 = t013 == 1, dn013 = t013 == -1
tr014 = t014 != t014[1], up014 = t014 == 1, dn014 = t014 == -1
tr015 = t015 != t015[1], up015 = t015 == 1, dn015 = t015 == -1
tr016 = t016 != t016[1], up016 = t016 == 1, dn016 = t016 == -1
tr017 = t017 != t017[1], up017 = t017 == 1, dn017 = t017 == -1
tr018 = t018 != t018[1], up018 = t018 == 1, dn018 = t018 == -1
tr019 = t019 != t019[1], up019 = t019 == 1, dn019 = t019 == -1
tr020 = t020 != t020[1], up020 = t020 == 1, dn020 = t020 == -1
tr021 = t021 != t021[1], up021 = t021 == 1, dn021 = t021 == -1
tr022 = t022 != t022[1], up022 = t022 == 1, dn022 = t022 == -1
tr023 = t023 != t023[1], up023 = t023 == 1, dn023 = t023 == -1
tr024 = t024 != t024[1], up024 = t024 == 1, dn024 = t024 == -1
tr025 = t025 != t025[1], up025 = t025 == 1, dn025 = t025 == -1
tr026 = t026 != t026[1], up026 = t026 == 1, dn026 = t026 == -1
tr027 = t027 != t027[1], up027 = t027 == 1, dn027 = t027 == -1
tr028 = t028 != t028[1], up028 = t028 == 1, dn028 = t028 == -1
tr029 = t029 != t029[1], up029 = t029 == 1, dn029 = t029 == -1
tr030 = t030 != t030[1], up030 = t030 == 1, dn030 = t030 == -1
tr031 = t031 != t031[1], up031 = t031 == 1, dn031 = t031 == -1
tr032 = t032 != t032[1], up032 = t032 == 1, dn032 = t032 == -1
tr033 = t033 != t033[1], up033 = t033 == 1, dn033 = t033 == -1
tr034 = t034 != t034[1], up034 = t034 == 1, dn034 = t034 == -1
tr035 = t035 != t035[1], up035 = t035 == 1, dn035 = t035 == -1
tr036 = t036 != t036[1], up036 = t036 == 1, dn036 = t036 == -1
tr037 = t037 != t037[1], up037 = t037 == 1, dn037 = t037 == -1
tr038 = t038 != t038[1], up038 = t038 == 1, dn038 = t038 == -1
pot_label = 'Potential Reversal: ₩n'
pot_label := tr01 ? pot_label + t1 + '₩n' : pot_label
pot_label := tr02 ? pot_label + t2 + '₩n' : pot_label
pot_label := tr03 ? pot_label + t3 + '₩n' : pot_label
pot_label := tr04 ? pot_label + t4 + '₩n' : pot_label
pot_label := tr05 ? pot_label + t5 + '₩n' : pot_label
pot_label := tr06 ? pot_label + t6 + '₩n' : pot_label
pot_label := tr07 ? pot_label + t7 + '₩n' : pot_label
pot_label := tr08 ? pot_label + t8 + '₩n' : pot_label
pot_label := tr09 ? pot_label + t9 + '₩n' : pot_label
pot_label := tr010 ? pot_label + t10 + '₩n' : pot_label
pot_label := tr011 ? pot_label + t11 + '₩n' : pot_label
pot_label := tr012 ? pot_label + t12 + '₩n' : pot_label
pot_label := tr013 ? pot_label + t13 + '₩n' : pot_label
pot_label := tr014 ? pot_label + t14 + '₩n' : pot_label
pot_label := tr015 ? pot_label + t15 + '₩n' : pot_label
pot_label := tr016 ? pot_label + t16 + '₩n' : pot_label
pot_label := tr017 ? pot_label + t17 + '₩n' : pot_label
pot_label := tr018 ? pot_label + t18 + '₩n' : pot_label
pot_label := tr019 ? pot_label + t19 + '₩n' : pot_label
pot_label := tr020 ? pot_label + t20 + '₩n' : pot_label
pot_label := tr021 ? pot_label + t21 + '₩n' : pot_label
pot_label := tr022 ? pot_label + t22 + '₩n' : pot_label
pot_label := tr023 ? pot_label + t23 + '₩n' : pot_label
pot_label := tr024 ? pot_label + t24 + '₩n' : pot_label
pot_label := tr025 ? pot_label + t25 + '₩n' : pot_label
pot_label := tr026 ? pot_label + t26 + '₩n' : pot_label
pot_label := tr027 ? pot_label + t27 + '₩n' : pot_label
pot_label := tr028 ? pot_label + t28 + '₩n' : pot_label
pot_label := tr029 ? pot_label + t29 + '₩n' : pot_label
pot_label := tr030 ? pot_label + t30 + '₩n' : pot_label
pot_label := tr031 ? pot_label + t31 + '₩n' : pot_label
pot_label := tr032 ? pot_label + t32 + '₩n' : pot_label
pot_label := tr033 ? pot_label + t33 + '₩n' : pot_label
pot_label := tr034 ? pot_label + t34 + '₩n' : pot_label
pot_label := tr035 ? pot_label + t35 + '₩n' : pot_label
pot_label := tr036 ? pot_label + t36 + '₩n' : pot_label
pot_label := tr037 ? pot_label + t37 + '₩n' : pot_label
pot_label := tr038 ? pot_label + t38 + '₩n' : pot_label
scr_label = 'Confirmed Reversal: ₩n'
scr_label := tr01[1] ? scr_label + t1 + '₩n' : scr_label
scr_label := tr02[1] ? scr_label + t2 + '₩n' : scr_label
scr_label := tr03[1] ? scr_label + t3 + '₩n' : scr_label
scr_label := tr04[1] ? scr_label + t4 + '₩n' : scr_label
scr_label := tr05[1] ? scr_label + t5 + '₩n' : scr_label
scr_label := tr06[1] ? scr_label + t6 + '₩n' : scr_label
scr_label := tr07[1] ? scr_label + t7 + '₩n' : scr_label
scr_label := tr08[1] ? scr_label + t8 + '₩n' : scr_label
scr_label := tr09[1] ? scr_label + t9 + '₩n' : scr_label
scr_label := tr010[1] ? scr_label + t10 + '₩n' : scr_label
scr_label := tr011[1] ? scr_label + t11 + '₩n' : scr_label
scr_label := tr012[1] ? scr_label + t12 + '₩n' : scr_label
scr_label := tr013[1] ? scr_label + t13 + '₩n' : scr_label
scr_label := tr014[1] ? scr_label + t14 + '₩n' : scr_label
scr_label := tr015[1] ? scr_label + t15 + '₩n' : scr_label
scr_label := tr016[1] ? scr_label + t16 + '₩n' : scr_label
scr_label := tr017[1] ? scr_label + t17 + '₩n' : scr_label
scr_label := tr018[1] ? scr_label + t18 + '₩n' : scr_label
scr_label := tr019[1] ? scr_label + t19 + '₩n' : scr_label
scr_label := tr020[1] ? scr_label + t20 + '₩n' : scr_label
scr_label := tr021[1] ? scr_label + t21 + '₩n' : scr_label
scr_label := tr022[1] ? scr_label + t22 + '₩n' : scr_label
scr_label := tr023[1] ? scr_label + t23 + '₩n' : scr_label
scr_label := tr024[1] ? scr_label + t24 + '₩n' : scr_label
scr_label := tr025[1] ? scr_label + t25 + '₩n' : scr_label
scr_label := tr026[1] ? scr_label + t26 + '₩n' : scr_label
scr_label := tr027[1] ? scr_label + t27 + '₩n' : scr_label
scr_label := tr028[1] ? scr_label + t28 + '₩n' : scr_label
scr_label := tr029[1] ? scr_label + t29 + '₩n' : scr_label
scr_label := tr030[1] ? scr_label + t30 + '₩n' : scr_label
scr_label := tr031[1] ? scr_label + t31 + '₩n' : scr_label
scr_label := tr032[1] ? scr_label + t32 + '₩n' : scr_label
scr_label := tr033[1] ? scr_label + t33 + '₩n' : scr_label
scr_label := tr034[1] ? scr_label + t34 + '₩n' : scr_label
scr_label := tr035[1] ? scr_label + t35 + '₩n' : scr_label
scr_label := tr036[1] ? scr_label + t36 + '₩n' : scr_label
scr_label := tr037[1] ? scr_label + t37 + '₩n' : scr_label
scr_label := tr038[1] ? scr_label + t38 + '₩n' : scr_label
f_colorscr (_valscr ) =>
_valscr ? #00000000 : na
f_printscr (_txtscr ) =>
var _lblscr = label(na),
label.delete(_lblscr ),
_lblscr := label.new(
time + (time-time[1])*posX_scr ,
ohlc4[posY_scr],
_txtscr ,
xloc.bar_time,
yloc.price,
f_colorscr ( showscr ),
textcolor = showscr ? col : na,
size = size.normal,
style=label.style_label_center
)
f_printscr ( scr_label + '₩n' + pot_label)
st_security(_symbol, _res, _src) => security(_symbol, _res, _src[barstate.isrealtime ? 1 : 0])
ST_Trend = st_security(syminfo.tickerid, timeframe.period, Trend)
ST_Tsl = st_security(syminfo.tickerid, timeframe.period, Tsl)
2024-07-04
1067
글번호 181226
답변완료
문의
10시15분 기준으로 부탁드립니다
var : A(0),B(0),D(0);
A=IFF(C>O,V,0);
B=Accum(A);
if bdate[1] != bDate Then
D = B[1];
var1 = B-D;
Plot1(var1);
2024-07-04
736
글번호 181225
답변완료
추세 실시간
input : Period(120);
Var:j(0),T(0),tx(0),tx1(0),TL(0);
Var: date11(0),date12(0),time11(0),time12(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0);
Array: HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
var : tx99count(0),L1(0);
Plot1(value12,"value12",IFf(t==1,Red,Blue));
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) Then
T = -1;
If T == -1 Then
{
If T[1] != -1 Then
{
For j = 18 DownTo 0
{
LoVal[j+1] = LoVal[j];
LoBar[j+1] = LoBar[j];
}
LoVal[0] = L;
LoBar[0] = 0;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
Text_SetSize(tx,25);
Text_SetColor(Tx,Red);
Text_SetStyle(tx,1,1);
Text_SetBold(tx,1);
if abs(value12[1]-value11[1]) < 0.8 Then
Text_Delete(tx);
tx = Text_New(sDate,stime,value12,NumToStr(value11-value12,2)+" ");
Text_SetColor(Tx,Blue);
Text_SetStyle(tx,1,0);
Text_SetSize(tx,25);
Text_SetBold(tx,1);
Condition99 = False;
tx99count = 0;
}
If LoVal[0] >= L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date22 = date[0];
time22 = stime[0];
Text_SetString(tx,NumToStr(value11-value12,2)+" ");
Text_SetLocation(tx,sDate,sTime,value12);
Condition99 = False;
}
if Condition99 == False and value12 <= value11-0.9 and h >= value12+PriceScale*3 Then
{
Condition99 = true;
L1 = value12;
tx99count = tx99count+1;
if tx99count >= 1 Then
{
tx1 = Text_New(date12,time12,L1-0.1,"■");
Text_SetStyle(tx1,2,2);
Text_SetColor(tx1,Red);
Text_SetSize(tx1,20);
}
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
}
HiVal[0] = H;
HiBar[0] = 0;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
Text_SetSize(tx,25);
Text_SetColor(Tx,Blue);
Text_SetStyle(tx,1,0);
Text_SetBold(tx,1);
if abs(value12[1]-value11[1]) < 0.9 Then
Text_Delete(tx);
tx = Text_New(sDate,stime,value12,NumToStr(value12-value11,2)+" ");
Text_SetColor(Tx,Red);
Text_SetStyle(tx,1,1);
Text_SetSize(tx,25);
Text_SetBold(tx,1);
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
date32 = date[0];
time32 = stime[0];
Text_SetString(tx,NumToStr(value12-value11,2)+" ");
Text_SetLocation(tx,sDate,sTime,value12);
}
}
하락추세선의 크기가 0.9 이상에서 3틱 반등 나올때마다 네모 표시하는 수식입니다.
현재 주가가 마지막 네모 표시될때의 반등 시작 최저점 기준으로
(네모 표시 시점의 봉 저점 아님,당시 그 근방 최저가,봉 고점 -3틱)
+1틱부터 -2틱 사이에 위치하면 현재봉 밑에 별표, 벗어나면 삭제.
잠깐 벗어났다 들어오면 다시 표시. (분봉 말고 20틱 차트에서 조회)
현 주가가 최근 네모와 쌍바닥 근방인지 보기 위함. 생성과 삭제 무한 반복됨. 감사합니다.
2024-07-04
1134
글번호 181223
살빼고싶다 님에 의해서 삭제되었습니다.
2024-07-04
32
글번호 181222
답변완료
가격 구간대별 거래량 합산
수고가 많으십니다.
예를 들어 아래의 수식 부탁 드립니다.
기간 : 240일,
가격구간 : 10,
가격 : 종가
1. 기간(240일)의 고가와 저가를 가격구간(10)으로 나누어 그 가격구간에서의 거래량 합산
2. 합산된 거래량의 순위를 정함.
3. 현재의 시점으로부터 과거 기간(240일)까지 10개의 가격구간에서 기간(240)일 전부터
가격차트에 수평선을 작성
예를 들어
1순위 거래량의 경우 기간(240일)전 부터 240 / 10 x 10 의 길이의 수평선
2순위 거래량의 경우 기간(240일)전 부터 240 / 10 x 9 의 길이의 수평선
.
.
10순위 거래량의 경우 기간(240일)전 부터 240 / 10 x 1 의 길이의 수평선
4. 날짜가 변하면 현재일을 기준으로 자동 변경이 되도록 부탁드립니다.
표현을 하려고 하니 잘 안되어 문의 드립니다.
수식 작성 부탁드립니다.
감사합니다.
2024-07-04
761
글번호 181216
답변완료
문의드립니다
매수 신호 이름에 따라서
하루N번 매매횟수제한을 각각 하고싶습니다
매수이름 A
매수이름 B
매수이름 C
1
ABC 각각 하루에 1번씩 매매횟수제한
2
A는 1회제한
B는 2회제한
C는 3회제한
2024-07-04
887
글번호 181215
답변완료
수식부탁드립니다
data2 청산신호시 data1 의 매수신호식 부탁드립니다.
예를들면
아래는 data2 에서 발생되는 신호입니다
C >dayopen 이면 매수하고 +20틱 이면 익절
C >dayopen 이면 매수하고 -20틱 이면 손절
위와 같이 data2에서 손절이 발생하면
data1 에서 매수신호 발생 (익절은 없고 손절때만)
2024-07-04
695
글번호 181214
답변완료
도움 부탁드립니다
안녕하세요
늘 감사드립니다.
전환선이 20 이평을 GC, DC 할때 매수매도 부탁드립니다.
수치는 변수 부탁드립니다
2024-07-04
773
글번호 181209