커뮤니티
예스랭귀지 Q&A
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1374
글번호 230811
답변완료
부틱드립니다
수고하십니다
트레이딩 뷰 수식입니다.
예스로적용가능하도록 부탁 드립니다.
아래 뷰 수식을 제가 참조해서 해봤는데 //plots 부분 과 전체적으로 수정부탁드립니다
input ; g(0.75),ob(0.80),os(0.20),smooth(1),coloring(true);
var : p(0),L0(0),L1(0),L2(0),L3(0),cu(0),cd(0);
p = c
L0 = 0.0
L1 = 0.0
L2 = 0.0
L3 = 0.0
L0 = (1 - g) * p + g * iff(IsNaN(L0[1])==False,L0[1],0);
L1 = -g * L0 + iff(IsNaN(L0[1])==False,L0[1],0) + g * iff(IsNaN(L1[1])==False,L1[1],0);
L2 = -g * L1 + iff(IsNaN(L1[1])==False,L1[1],0) + g * iff(IsNaN(L2[1])==False,L2[1],0);
L3 = -g * L2 + iff(IsNaN(L2[1])==False,L2[1],0) + g * iff(IsNaN(L3[1])==False,L3[1],0);
cu = IFf(L0 > L1 , L0 - L1 , 0) + IFf(L1 > L2 , L1 - L2 , 0) + IFf(L2 > L3 , L2 - L3 , 0);
cd = IFf(L0 < L1 , L1 - L0 , 0) + IFf(L1 < L2 , L2 - L1 , 0) + IFf(L2 < L3 , L3 - L2 , 0);
//plots
lrsi = ema((cu + cd == 0 ? -1 : cu + cd) == -1 ? 0 : cu / (cu + cd == 0 ? -1 : cu + cd), smooth)
col1 = lrsi > lrsi[1] and lrsi > os ? #00FF7B : lrsi < lrsi[1] and lrsi < ob ? #FF3571 : lrsi == lrsi ? #ECA700 : #ECA700
col2 = lrsi > lrsi[1] and lrsi > os ? #00FF7B : lrsi < lrsi[1] and lrsi < ob ? #FF3571 : lrsi < os ? #FF3571 : lrsi > ob ? #00FF7B : lrsi == lrsi ? #ECA700 : #ECA700
col = coloring ? col1 : col2
plot(lrsi, color=col, linewidth=2)
==============================================================
//@version=4
study("laguerre RSI v4 | LK", overlay=false)
//setups
h = high
l = low
o = open
c = close
//inputs
g = input(0.75, title="Gamma")
ob = input(0.80, title="Over Bought")
os = input(0.20, title="Over Sold")
smooth = input(1, minval=1, title="Smoothing (1 = off)")
coloring = input(true,title="3 colors?")
//calc
p = c
L0 = 0.0
L1 = 0.0
L2 = 0.0
L3 = 0.0
L0 := (1 - g) * p + g * nz(L0[1])
L1 := -g * L0 + nz(L0[1]) + g * nz(L1[1])
L2 := -g * L1 + nz(L1[1]) + g * nz(L2[1])
L3 := -g * L2 + nz(L2[1]) + g * nz(L3[1])
cu = (L0 > L1 ? L0 - L1 : 0) + (L1 > L2 ? L1 - L2 : 0) + (L2 > L3 ? L2 - L3 : 0)
cd = (L0 < L1 ? L1 - L0 : 0) + (L1 < L2 ? L2 - L1 : 0) + (L2 < L3 ? L3 - L2 : 0)
//plots
lrsi = ema((cu + cd == 0 ? -1 : cu + cd) == -1 ? 0 : cu / (cu + cd == 0 ? -1 : cu + cd), smooth)
col1 = lrsi > lrsi[1] and lrsi > os ? #00FF7B : lrsi < lrsi[1] and lrsi < ob ? #FF3571 : lrsi == lrsi ? #ECA700 : #ECA700
col2 = lrsi > lrsi[1] and lrsi > os ? #00FF7B : lrsi < lrsi[1] and lrsi < ob ? #FF3571 : lrsi < os ? #FF3571 : lrsi > ob ? #00FF7B : lrsi == lrsi ? #ECA700 : #ECA700
col = coloring ? col1 : col2
plot(lrsi, color=col, linewidth=2)
2024-09-29
853
글번호 183828
답변완료
부틱드립니다
수고하십니다
트레이딩 뷰 수식입니다.
예스로적용가능하도록 부탁 드립니다.
plot1,plot2 선는 제가 했는데 맨아래에 //Plots →→ //GMA 밴드중심 선은 할수가없어서 중심선만 수식부탁드립니다
input : zlmaSource(close),zlmaFastLength(8),zlmaSlowLength(21);
var : zema1(0),zema2(0),c1(0),c2(0),zema3(0),zema4(0),zlemaFast(0),zlemaSlow(0);
// Fast ZeroLag EMA
zema1 = ema(zlmaSource, zlmaFastLength);
zema2 = ema(zema1, zlmaFastLength);
c1=zema1-zema2;
zlemaFast=zema1+c1;
// Slow ZeroLag EMA
zema3=ema(zlmaSource, zlmaSlowLength);
zema4=ema(zema3, zlmaSlowLength);
c2=zema3-zema4;
zlemaSlow=zema3+c2;
plot1(zlemaFast, "Fast ZeroLag EMA",Yellow,Def,2);
plot2(zlemaSlow, "Slow ZeroLag EMA",Magenta,Def,3);
--------------------------------------------------------------------------------------------
//@version=3
// Help from coryt, some design ideas from DonovanWall.
strategy("MP ZeroLag EMA", "MP 0 Strat", overlay=true, pyramiding=0, initial_capital=100000, currency=currency.USD, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, commission_type=strategy.commission.percent, commission_value=0.1)
//bgcolor ( color=black, transp=40, title='Blackground', editable=true)
///////////////////////////////////////////////
//* Backtesting Period Seletor | Component *//
///////////////////////////////////////////////
testStartYear = input(2018, "Backtest Start Year")
testStartMonth = input(3, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,00,00)
testStopYear = input(77777777, "Backtest Stop Year")
testStopMonth = input(11, "Backtest Stop Month")
testStopDay = input(15, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)
testPeriod() =>
time >= testPeriodStart and time <= testPeriodStop ? true : false
/////////////////////////////////////
//* Put your strategy logic below *//
/////////////////////////////////////
// === INPUTS ===
zlmaSource = input(defval = close, title = "ZeroLag EMA Source", type = source)
zlmaFastLength = input(defval = 8, title = "ZeroLag EMA Fast Length", type = integer)
zlmaSlowLength = input(defval = 21, title = "ZeroLag EMA Slow Length", type = integer)
// === /INPUTS ===
// === SERIES SETUP ===
// Fast ZeroLag EMA
zema1=ema(zlmaSource, zlmaFastLength)
zema2=ema(zema1, zlmaFastLength)
c1=zema1-zema2
zlemaFast=zema1+c1
// Slow ZeroLag EMA
zema3=ema(zlmaSource, zlmaSlowLength)
zema4=ema(zema3, zlmaSlowLength)
c2=zema3-zema4
zlemaSlow=zema3+c2
// Plots and Conditions
plot(zlemaFast, title='Fast ZeroLag EMA', color = yellow, linewidth=4)
plot(zlemaSlow, title='Slow ZeroLag EMA', color = fuchsia, linewidth=4)
// Long/Short Logic
longLogic = crossover(zlemaFast,zlemaSlow) ? 1 : 0
shortLogic = crossunder(zlemaFast,zlemaSlow) ? 1 : 0
//////////////////////////
//* Strategy Component *//
//////////////////////////
isLong = input(false, "Longs Only")
isShort = input(false, "Shorts Only")
isFlip = input(false, "Flip the Opens")
long = longLogic
short = shortLogic
if isFlip
long := shortLogic
short := longLogic
else
long := longLogic
short := shortLogic
if isLong
long := long
short := na
if isShort
long := na
short := short
////////////////////////////////
//======[ Signal Count ]======//
////////////////////////////////
sectionLongs = 0
sectionLongs := nz(sectionLongs[1])
sectionShorts = 0
sectionShorts := nz(sectionShorts[1])
if long
sectionLongs := sectionLongs + 1
sectionShorts := 0
if short
sectionLongs := 0
sectionShorts := sectionShorts + 1
//////////////////////////////
//======[ Pyramiding ]======//
//////////////////////////////
pyrl = input(1, "Pyramiding less than") // If your count is less than this number
pyre = input(0, "Pyramiding equal to") // If your count is equal to this number
pyrg = input(1000000, "Pyramiding greater than") // If your count is greater than this number
longCondition = long and sectionLongs <= pyrl or long and sectionLongs >= pyrg or long and sectionLongs == pyre ? 1 : 0
shortCondition = short and sectionShorts <= pyrl or short and sectionShorts >= pyrg or short and sectionShorts == pyre ? 1 : 0
////////////////////////////////
//======[ Entry Prices ]======//
////////////////////////////////
last_open_longCondition = na
last_open_shortCondition = na
last_open_longCondition := longCondition ? close : nz(last_open_longCondition[1])
last_open_shortCondition := shortCondition ? close : nz(last_open_shortCondition[1])
////////////////////////////////////
//======[ Open Order Count ]======//
////////////////////////////////////
sectionLongConditions = 0
sectionLongConditions := nz(sectionLongConditions[1])
sectionShortConditions = 0
sectionShortConditions := nz(sectionShortConditions[1])
if longCondition
sectionLongConditions := sectionLongConditions + 1
sectionShortConditions := 0
if shortCondition
sectionLongConditions := 0
sectionShortConditions := sectionShortConditions + 1
///////////////////////////////////////////////
//======[ Position Check (long/short) ]======//
///////////////////////////////////////////////
last_longCondition = na
last_shortCondition = na
last_longCondition := longCondition ? time : nz(last_longCondition[1])
last_shortCondition := shortCondition ? time : nz(last_shortCondition[1])
in_longCondition = last_longCondition > last_shortCondition
in_shortCondition = last_shortCondition > last_longCondition
/////////////////////////////////////
//======[ Position Averages ]======//
/////////////////////////////////////
totalLongs = 0.0
totalLongs := nz(totalLongs[1])
totalShorts = 0.0
totalShorts := nz(totalShorts[1])
averageLongs = 0.0
averageLongs := nz(averageLongs[1])
averageShorts = 0.0
averageShorts := nz(averageShorts[1])
if longCondition
totalLongs := totalLongs + last_open_longCondition
totalShorts := 0.0
if shortCondition
totalLongs := 0.0
totalShorts := totalShorts + last_open_shortCondition
averageLongs := totalLongs / sectionLongConditions
averageShorts := totalShorts / sectionShortConditions
/////////////////////////////////
//======[ Trailing Stop ]======//
/////////////////////////////////
isTS = input(false, "Trailing Stop")
tsi = input(1300, "Activate Trailing Stop Price (%). Divided by 100 (1 = 0.01%)") / 100
ts = input(400, "Trailing Stop (%). Divided by 100 (1 = 0.01%)") / 100
last_high = na
last_low = na
last_high_short = na
last_low_short = na
last_high := not in_longCondition ? na : in_longCondition and (na(last_high[1]) or high > nz(last_high[1])) ? high : nz(last_high[1])
last_high_short := not in_shortCondition ? na : in_shortCondition and (na(last_high[1]) or high > nz(last_high[1])) ? high : nz(last_high[1])
last_low := not in_shortCondition ? na : in_shortCondition and (na(last_low[1]) or low < nz(last_low[1])) ? low : nz(last_low[1])
last_low_short := not in_longCondition ? na : in_longCondition and (na(last_low[1]) or low < nz(last_low[1])) ? low : nz(last_low[1])
long_ts = isTS and not na(last_high) and low <= last_high - last_high / 100 * ts and longCondition == 0 and last_high >= averageLongs + averageLongs / 100 * tsi
short_ts = isTS and not na(last_low) and high >= last_low + last_low / 100 * ts and shortCondition == 0 and last_low <= averageShorts - averageShorts/ 100 * tsi
///////////////////////////////
//======[ Take Profit ]======//
///////////////////////////////
isTP = input(true, "Take Profit")
tp = input(300, "Take Profit (%). Divided by 100 (1 = 0.01%)") / 100
long_tp = isTP and close > averageLongs + averageLongs / 100 * tp and not longCondition
short_tp = isTP and close < averageShorts - averageShorts / 100 * tp and not shortCondition
/////////////////////////////
//======[ Stop Loss ]======//
/////////////////////////////
isSL = input(false, "Stop Loss")
sl = input(750, "Stop Loss (%). Divided by 100 (1 = 0.01%)") / 100
long_sl = isSL and close < averageLongs - averageLongs / 100 * sl and longCondition == 0
short_sl = isSL and close > averageShorts + averageShorts / 100 * sl and shortCondition == 0
/////////////////////////////////
//======[ Close Signals ]======//
/////////////////////////////////
longClose = long_tp or long_sl or long_ts ? 1 : 0
shortClose = short_tp or short_sl or short_ts ? 1: 0
///////////////////////////////
//======[ Plot Colors ]======//
///////////////////////////////
longCloseCol = na
shortCloseCol = na
longCloseCol := long_tp ? purple : long_sl ? maroon : long_ts ? blue : longCloseCol[1]
shortCloseCol := short_tp ? purple : short_sl ? maroon : short_ts ? blue : shortCloseCol[1]
tpColor = isTP and in_longCondition ? purple : isTP and in_shortCondition ? purple : white
slColor = isSL and in_longCondition ? red : isSL and in_shortCondition ? red : white
//////////////////////////////////
//======[ Strategy Plots ]======//
//////////////////////////////////
plot(isTS and in_longCondition ? averageLongs + averageLongs / 100 * tsi : na, "Long Trailing Activate", blue, style=3, linewidth=2)
plot(isTS and in_longCondition and last_high >= averageLongs + averageLongs / 100 * tsi ? last_high - last_high / 100 * ts : na, "Long Trailing", fuchsia, style=2, linewidth=3)
plot(isTS and in_shortCondition ? averageShorts - averageShorts/ 100 * tsi : na, "Short Trailing Activate", blue, style=3, linewidth=2)
plot(isTS and in_shortCondition and last_low <= averageShorts - averageShorts/ 100 * tsi ? last_low + last_low / 100 * ts : na, "Short Trailing", fuchsia, style=2, linewidth=3)
plot(isTP and in_longCondition and last_high < averageLongs + averageLongs / 100 * tp ? averageLongs + averageLongs / 100 * tp : na, "Long TP", tpColor, style=3, linewidth=2)
plot(isTP and in_shortCondition and last_low > averageShorts - averageShorts / 100 * tp ? averageShorts - averageShorts / 100 * tp : na, "Short TP", tpColor, style=3, linewidth=2)
plot(isSL and in_longCondition and last_low_short > averageLongs - averageLongs / 100 * sl ? averageLongs - averageLongs / 100 * sl : na, "Long SL", slColor, style=3, linewidth=2)
plot(isSL and in_shortCondition and last_high_short < averageShorts + averageShorts / 100 * sl ? averageShorts + averageShorts / 100 * sl : na, "Short SL", slColor, style=3, linewidth=2)
///////////////////////////////
//======[ Alert Plots ]======//
///////////////////////////////
// Old Signal Plots
//plot(longCondition, "Long", green)
//plot(shortCondition, "Short", red)
//plot(longClose, "Long Close", longCloseCol)
//plot(shortClose, "Short Close", shortCloseCol)
// New Signal Plots
//plotshape(series=longCondition, title="Long", style=shape.triangleup, location=location.belowbar, color=green, size=size.tiny)
//plotshape(series=shortCondition, title="Short", style=shape.triangledown, location=location.abovebar, color=red, size=size.tiny)
//plotshape(series=longClose, title="Long Close", style=shape.triangleup, location=location.belowbar, color=blue, size=size.tiny)
//plotshape(series=shortClose, title="Short Close", style=shape.triangledown, location=location.abovebar, color=purple, size=size.tiny)
//alertcondition(condition=longCondition, title="Long", message="")
//alertcondition(condition=shortCondition, title="Short", message="")
//alertcondition(condition=longClose, title="Long Close", message="")
//alertcondition(condition=shortClose, title="Short Close", message="")
///////////////////////////////////
//======[ Reset Variables ]======//
///////////////////////////////////
if longClose or not in_longCondition
averageLongs := 0
totalLongs := 0.0
sectionLongs := 0
sectionLongConditions := 0
if shortClose or not in_shortCondition
averageShorts := 0
totalShorts := 0.0
sectionShorts := 0
sectionShortConditions := 0
////////////////////////////////////////////
//======[ Strategy Entry and Exits ]======//
////////////////////////////////////////////
if testPeriod()
strategy.entry("Long", 1, when=longCondition)
strategy.entry("Short", 0, when=shortCondition)
strategy.close("Long", when=longClose)
strategy.close("Short", when=shortClose)
//////NEW STUFF
//temainput = input(24, minval=1, title="Fast TEMA")
//hullinput = input(39, minval=1, title="Slow hullMA")
//rmainput = input(48, minval=1, title="RMA (BB Signal)")
//bblength = input(20, minval=1, title="BB Length")
//mult = input(1.5, minval=0.001, maxval=50, title="BB stdev Mult")
//src = input(defval=close, type=source, title="Source")
//Moving Average Params
//hullMA
//hullma = wma(2*wma(close, hullinput/2)-wma(close, hullinput), round(sqrt(hullinput)))
//TEMA
//ema = ema(close, temainput)
//ema1 = ema(ema, temainput)
//ema2 = ema(ema1, temainput)
//tema = 3 * (ema - ema1) + ema2
//RMA
//rma = ema(close, 96)
//BB
//basis = sma(tema, bblength)
//dev = mult * stdev(tema, bblength)
//upper = basis + dev
//lower = basis - dev
//Color Swaps
//ribbon = tema>=hullma ? #c0fff4 : #ffbcc8
//bandcolor = rma>=basis ? #ffbcc8 : #c0fff4
//Plots
//plot(basis, title="Bollinger Band Basis", color=red, transp=0)
//upband = plot(upper, color=#ffbcc8, transp=100, editable=false)
//downband = plot(lower, color=#ffbcc8, transp=100, editable=false)
//Fills
//temap = plot(tema, title="TEMA", color=white, transp=100, editable=false)
//emap = plot(hullma, title="EMA", color=white, transp=100, editable=false)
//fill (temap, emap, color=ribbon, title="MA Ribbon", transp=50)
//fill(upband, downband, title="Bollinger Band Background", color=bandcolor)
///////END NEW
///--------New, DW Art----------
//Period
per = input(defval=34, title="Lookback Period")
//Current Resolution
res = input(defval=30, title="Resolution")
//Deviations
ndev = input(defval=7, minval=0, maxval=7, title="Number of Fibonacci Volatility Deviations")
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Definitions
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Source
src = close
dsrc = high - low
//Periods Per Annum
ppa = (1440/res)*365
//Periodic Volatility
Si = log(close/close[1])
Sm = avg(Si, per)
pv = (sqrt((sum(pow((Si - Sm), 2), per))/(per*ppa)))
//Price Geometric Moving Averages
lmean = log(src)
smean = sum(lmean,per)
gma = exp(smean/per)
lmeand = log(dsrc)
smeand = sum(lmeand,per)
gmad = exp(smeand/per)
//Deviations
dev = gmad*pv
ud1 = gma + dev
dd1 = gma - dev
ud2 = gma + dev*2
dd2 = gma - dev*2
ud3 = gma + dev*3
dd3 = gma - dev*3
ud5 = gma + dev*5
dd5 = gma - dev*5
ud8 = gma + dev*8
dd8 = gma - dev*8
ud13 = gma + dev*13
dd13 = gma - dev*13
ud21 = gma + dev*21
dd21 = gma - dev*21
u1 = (ndev==1) or (ndev==2) or (ndev==3) or (ndev==4) or (ndev==5) or (ndev==6) or (ndev==7) ? ud1 : na
d1 = (ndev==1) or (ndev==2) or (ndev==3) or (ndev==4) or (ndev==5) or (ndev==6) or (ndev==7) ? dd1 : na
u2 = (ndev==2) or (ndev==3) or (ndev==4) or (ndev==5) or (ndev==6) or (ndev==7) ? ud2 : na
d2 = (ndev==2) or (ndev==3) or (ndev==4) or (ndev==5) or (ndev==6) or (ndev==7) ? dd2 : na
u3 = (ndev==3) or (ndev==4) or (ndev==5) or (ndev==6) or (ndev==7) ? ud3 : na
d3 = (ndev==3) or (ndev==4) or (ndev==5) or (ndev==6) or (ndev==7) ? dd3 : na
u5 = (ndev==4) or (ndev==5) or (ndev==6) or (ndev==7) ? ud5 : na
d5 = (ndev==4) or (ndev==5) or (ndev==6) or (ndev==7) ? dd5 : na
u8 = (ndev==5) or (ndev==6) or (ndev==7) ? ud8 : na
d8 = (ndev==5) or (ndev==6) or (ndev==7) ? dd8 : na
u13 = (ndev==6) or (ndev==7) ? ud13 : na
d13 = (ndev==6) or (ndev==7) ? dd13 : na
u21 = (ndev==7) ? ud21 : na
d21 = (ndev==7) ? dd21 : na
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Plots
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//GMA
gp = plot(gma, color=black, title="GMA")
//Deviations
u21p = plot(u21, color=lime, title="Upper Deviation x 21", transp=100)
u13p = plot(u13, color=lime, title="Upper Deviation x 13", transp=100)
u8p = plot(u8, color=lime, title="Upper Deviation x 8", transp=100)
u5p = plot(u5, color=lime, title="Upper Deviation x 5", transp=100)
u3p = plot(u3, color=lime, title="Upper Deviation x 3", transp=100)
u2p = plot(u2, color=lime, title="Upper Deviation x 2", transp=100)
u1p = plot(u1, color=lime, title="Uper Deviation", transp=100)
d1p = plot(d1, color=red, title="Lower Deviation", transp=100)
d2p = plot(d2, color=red, title="Lower Deviation x 2", transp=100)
d3p = plot(d3, color=red, title="Lower Deviation x 3", transp=100)
d5p = plot(d5, color=red, title="Lower Deviation x 5", transp=100)
d8p = plot(d8, color=red, title="Lower Deviation x 8", transp=100)
d13p = plot(d13, color=red, title="Lower Deviation x 13", transp=100)
d21p = plot(d21, color=red, title="Lower Deviation x 21", transp=100)
//Fills
fill(u21p, gp, color=silver, transp=90)
fill(u13p, gp, color=silver, transp=90)
fill(u8p, gp, color=silver, transp=90)
fill(u5p, gp, color=silver, transp=90)
fill(u3p, gp, color=silver, transp=90)
fill(u2p, gp, color=silver, transp=90)
fill(u1p, gp, color=silver, transp=90)
fill(d1p, gp, color=silver, transp=90)
fill(d2p, gp, color=silver, transp=90)
fill(d3p, gp, color=silver, transp=90)
fill(d5p, gp, color=silver, transp=90)
fill(d8p, gp, color=silver, transp=90)
fill(d13p, gp, color=silver, transp=90)
fill(d21p, gp, color=silver, transp=90)
2024-09-29
1190
글번호 183827
답변완료
예스트레이더 종목검색으로 요청합니다^^*
항상 감사합니다..
3가지 조건을 각각 예스트레이더 종목검색으로 부탁드립니다...
아래 수식은 예스트레이더 검색에 신저가(차트전체) 입니다.
1.조건을 추가적으로 신저가(차트전체)발생후 5일선을 돌파하는 예스종목검색으로 작성
부탁합니다...
variables: LowestLo( 0 ) ;
if CurrentBar == 1 then{
LowestLo = Low;
}
else if Low < LowestLo then {
Plot1( Low, "NewLo-Ch" ) ;
LowestLo = Low ;
}
2.조건을 추가적으로 신저가(차트전체)발생후 아래 영웅문 신호검색수식 조건에
맞게 예스트레이더 종목검색 요청합니다.(즉 신저가(차트전체)발생후 A수식이B수식을 돌파하는 조건)
A=(highest(high,shortPeriod)+lowest(low,shortPeriod)+highest(high,midPeriod)+lowest(low,midPeriod))/4;
B=ma(c,20);
crossup(A,B)
*지표변수
shortperiod : 9
midperiod : 26
3.조건을 추가적으로 신저가(차트전체)발생후 전환선이 단순이평40일선을 돌파하는 조건을 예스종목검색으로 요청합니다..
*전환선 수식
(highest(high,shortPeriod)+lowest(low,shortPeriod))/2
-지표변수
shortperiod : 9
2024-09-30
948
글번호 183826
답변완료
종목 검색식 부탁드립니다.
ap=(high+low+close)/3;
esa=eavg(ap,10);
d=eavg(abs(ap-esa), 10);
ci=(ap-esa)/(0.015*d);
WT=eavg(ci,21);
WT_s=avg(WT,4);
조건=WT>WT(1) && WT(1)<WT(2) && WT(1)<-53;
A=Valuewhen(1,조건,WT(1));
B=Valuewhen(2,조건,WT(1));
조건 && A>=B
2024-09-29
930
글번호 183825
답변완료
종목검색식 부탁드림니다.
항상 노고에 감사드림니다.
아래의 수식을 종목검색식으로 부탁드림니다.
일목균형표 후행스팬 shift(close,-midPeriod+1)
BBandsUp(Period1,D1)
BBandsUp(Period2,D1-1)
지표조건
midPeriod 26
period1 30
period2 20
D1 1.81
D1-1 2.0
볼린져밴드를 일목균형표 선행스팬1 과 선행스팬2로 변환하여 일목균형표 후행스팬이 선행스팬1 과 선행스팬2를 돌파하는 검색식입니다.
다음 종목검색식이 하나 더 있습니다.
S=SUM(1);
A=VALUEWHEN(1,624-S==20,(종가+시가)/2);
CROSSUP(C,A)
2024-09-29
869
글번호 183824
답변완료
시스템수식 부탁드립니다.
안녕하세요
예스스탁입니다.
Input : af(0.02), maxAF(0.2);
Var : Sarv(0);
Sarv = sar(af,maxAF);
If crossup(c,Sarv) Then
{
Buy();
}
If CrossDown(c,Sarv) Then
{
Sell();
}
위 수식으로 하면 진입하고 파라볼릭 신호변경시 청산 후 변경된 신호로
진입이 안되는것 같습니다. 혹시 봉 두개 발생 후 세번째에 진입이 되도록
수정 부탁드립니다.
2024-09-29
888
글번호 183823
답변완료
89264번 재문의입니다.
답변 내용이 해석이 안되 재문의 드립니다.
매수든 매도든 진입신호 발생후 청산식을 딱 1번만 나오게 만들고 싶은데
예스수식으로 구현이 불가능하다는 의미인지 궁금합니다.
수식에 문제가 없다는데 다계약에서 바로 뒤에도 같은 청산식이 연달아서 나옵니다.
다계약으로 진입된 후 여러 청산식중에서 한번 나온 청산식은
진입이 최종 종료되기전까지 단 1번만 적용되는 식을 원하는데
예스수식에서 구현이 불가능하다는 의미인지 아니면 문제가 전혀 없는데
제가 잘못 본 것인지 명료하게 답변해주시길 부탁 드립니다.
2024-09-29
959
글번호 183822
답변완료
부틱드립니다
수고하십니다
트레이딩 뷰 수식입니다.
예스로적용가능하도록 부탁 드립니다.
아래수식 === PLOTTING ===에서
closeP=plot(closeSeriesAlt, title = "Close Series", color = trendColour, linewidth = 2, style = line, transp = 20)
openP=plot(openSeriesAlt, title = "Open Series", color = trendColour, linewidth = 2, style = line, transp = 20)
두 선만 나타나게 부탁드립니다
strategy(title = "Open Close Cross Strategy R5.1 revised by JustUncleL", shorttitle = "OCC Strategy R5.1", overlay = true,
pyramiding = 0, default_qty_type = strategy.percent_of_equity, default_qty_value = 10, calc_on_every_tick=false)
// === INPUTS ===
useRes = input(defval = true, title = "Use Alternate Resolution?")
intRes = input(defval = 3, title = "Multiplier for Alernate Resolution")
stratRes = ismonthly? tostring(interval*intRes,"###M") : isweekly? tostring(interval*intRes,"###W") : isdaily? tostring(interval*intRes,"###D") : isintraday ? tostring(interval*intRes,"####") : '60'
basisType = input(defval = "SMMA", title = "MA Type: ", options=["SMA", "EMA", "DEMA", "TEMA", "WMA", "VWMA", "SMMA", "HullMA", "LSMA", "ALMA", "SSMA", "TMA"])
basisLen = input(defval = 8, title = "MA Period", minval = 1)
offsetSigma = input(defval = 6, title = "Offset for LSMA / Sigma for ALMA", minval = 0)
offsetALMA = input(defval = 0.85, title = "Offset for ALMA", minval = 0, step = 0.01)
scolor = input(false, title="Show coloured Bars to indicate Trend?")
delayOffset = input(defval = 0, title = "Delay Open/Close MA (Forces Non-Repainting)", minval = 0, step = 1)
tradeType = input("BOTH", title="What trades should be taken : ", options=["LONG", "SHORT", "BOTH", "NONE"])
// === /INPUTS ===
// Constants colours that include fully non-transparent option.
green100 = #008000FF
lime100 = #00FF00FF
red100 = #FF0000FF
blue100 = #0000FFFF
aqua100 = #00FFFFFF
darkred100 = #8B0000FF
gray100 = #808080FF
// === BASE FUNCTIONS ===
// Returns MA input seletion variant, default to SMA if blank or typo.
variant(type, src, len, offSig, offALMA) =>
v1 = sma(src, len) // Simple
v2 = ema(src, len) // Exponential
v3 = 2 * v2 - ema(v2, len) // Double Exponential
v4 = 3 * (v2 - ema(v2, len)) + ema(ema(v2, len), len) // Triple Exponential
v5 = wma(src, len) // Weighted
v6 = vwma(src, len) // Volume Weighted
v7 = 0.0
v7 := na(v7[1]) ? sma(src, len) : (v7[1] * (len - 1) + src) / len // Smoothed
v8 = wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len))) // Hull
v9 = linreg(src, len, offSig) // Least Squares
v10 = alma(src, len, offALMA, offSig) // Arnaud Legoux
v11 = sma(v1,len) // Triangular (extreme smooth)
// SuperSmoother filter
// ⓒ 2013 John F. Ehlers
a1 = exp(-1.414*3.14159 / len)
b1 = 2*a1*cos(1.414*3.14159 / len)
c2 = b1
c3 = (-a1)*a1
c1 = 1 - c2 - c3
v12 = 0.0
v12 := c1*(src + nz(src[1])) / 2 + c2*nz(v12[1]) + c3*nz(v12[2])
type=="EMA"?v2 : type=="DEMA"?v3 : type=="TEMA"?v4 : type=="WMA"?v5 : type=="VWMA"?v6 : type=="SMMA"?v7 : type=="HullMA"?v8 : type=="LSMA"?v9 : type=="ALMA"?v10 : type=="TMA"?v11: type=="SSMA"?v12: v1
// security wrapper for repeat calls
reso(exp, use, res) => use ? security(tickerid, res, exp, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on) : exp
// === /BASE FUNCTIONS ===
// === SERIES SETUP ===
closeSeries = variant(basisType, close[delayOffset], basisLen, offsetSigma, offsetALMA)
openSeries = variant(basisType, open[delayOffset], basisLen, offsetSigma, offsetALMA)
// === /SERIES ===
// === PLOTTING ===
// Get Alternate resolution Series if seleced.
closeSeriesAlt = reso(closeSeries, useRes, stratRes)
openSeriesAlt = reso(openSeries, useRes, stratRes)
//
trendColour = (closeSeriesAlt > openSeriesAlt) ? green : red
bcolour = (closeSeries > openSeriesAlt) ? lime100 : red100
barcolor(scolor?bcolour:na, title = "Bar Colours")
closeP=plot(closeSeriesAlt, title = "Close Series", color = trendColour, linewidth = 2, style = line, transp = 20)
openP=plot(openSeriesAlt, title = "Open Series", color = trendColour, linewidth = 2, style = line, transp = 20)
fill(closeP,openP,color=trendColour,transp=80)
// === /PLOTTING ===
//
//
// === ALERT conditions
xlong = crossover(closeSeriesAlt, openSeriesAlt)
xshort = crossunder(closeSeriesAlt, openSeriesAlt)
longCond = xlong // alternative: longCond[1]? false : (xlong or xlong[1]) and close>closeSeriesAlt and close>=open
shortCond = xshort // alternative: shortCond[1]? false : (xshort or xshort[1]) and close<closeSeriesAlt and close<=open
// === /ALERT conditions.
// === STRATEGY ===
// stop loss
slPoints = input(defval = 0, title = "Initial Stop Loss Points (zero to disable)", minval = 0)
tpPoints = input(defval = 0, title = "Initial Target Profit Points (zero for disable)", minval = 0)
// Include bar limiting algorithm
ebar = input(defval = 10000, title="Number of Bars for Back Testing", minval=0)
dummy = input(false, title="- SET to ZERO for Daily or Longer Timeframes" )
//
// Calculate how many mars since last bar
tdays = (timenow-time)/60000.0 // number of minutes since last bar
tdays := ismonthly? tdays/1440.0/5.0/4.3/interval : isweekly? tdays/1440.0/5.0/interval : isdaily? tdays/1440.0/interval : tdays/interval // number of bars since last bar
//
//set up exit parameters
TP = tpPoints>0?tpPoints:na
SL = slPoints>0?slPoints:na
// Make sure we are within the bar range, Set up entries and exit conditions
if ((ebar==0 or tdays<=ebar) and tradeType!="NONE")
strategy.entry("long", strategy.long, when=longCond==true and tradeType!="SHORT")
strategy.entry("short", strategy.short, when=shortCond==true and tradeType!="LONG")
strategy.close("long", when = shortCond==true and tradeType=="LONG")
strategy.close("short", when = longCond==true and tradeType=="SHORT")
strategy.exit("XL", from_entry = "long", profit = TP, loss = SL)
strategy.exit("XS", from_entry = "short", profit = TP, loss = SL)
// === /STRATEGY ===
// eof
2024-09-28
1049
글번호 183821
답변완료
검색식 부탁합니다
검색시 부탁드립니다.(New SQUEEZE MOMENTUM)
조건은 하부 지표에서
1) 색상이 적색에서 노랑색으로 변하는 지점에서의 검색식 부탁합니다
input : length(20),BB_mult(2.0);
var : BB_basis(0),dev(0),BB_upper(0),BB_lower(0);
BB_basis = ma(close, length);
dev = BB_mult * std(close, length);
BB_upper = BB_basis + dev;
BB_lower = BB_basis - dev;
input : KC_mult_high(1.0);
input : KC_mult_mid(1.5);
input : KC_mult_low(2.0);
var : KC_basis(0),devKC(0);
var : KC_upper_high(0),KC_lower_high(0);
var : KC_upper_mid(0),KC_lower_mid(0);
var : KC_upper_low(0),KC_lower_low(0);
var : NoSqz(False),LowSqz(False),MidSqz(False),HighSqz(False);
var : mom(0),iff_1(0),iff_2(0),mom_color(0),sq_color(0);
KC_basis = ma(close, length);
devKC = ma(TrueRange, length);
KC_upper_high = KC_basis + devKC * KC_mult_high;
KC_lower_high = KC_basis - devKC * KC_mult_high;
KC_upper_mid = KC_basis + devKC * KC_mult_mid;
KC_lower_mid = KC_basis - devKC * KC_mult_mid;
KC_upper_low = KC_basis + devKC * KC_mult_low;
KC_lower_low = KC_basis - devKC * KC_mult_low;
//SQUEEZE CONDITIONS
NoSqz = BB_lower < KC_lower_low or BB_upper > KC_upper_low; //NO SQUEEZE: GREEN
LowSqz = BB_lower >= KC_lower_low or BB_upper <= KC_upper_low; //LOW COMPRESSION: BLACK
MidSqz = BB_lower >= KC_lower_mid or BB_upper <= KC_upper_mid ;//MID COMPRESSION: RED
HighSqz = BB_lower >= KC_lower_high or BB_upper <= KC_upper_high; //HIGH COMPRESSION: ORANGE
//MOMENTUM OSCILLATOR
mom = LRL(close - avg(avg(highest(high, length), lowest(low, length)),ma(close, length)), length);
//MOMENTUM HISTOGRAM COLOR
iff_1 = iff(mom > iff(isnan(mom[1])==true,0,mom[1]) , Cyan , Blue);
iff_2 = iff(mom < iff(isnan(mom[1])==true,0,mom[1]) , red , yellow);
mom_color = iff(mom > 0 , iff_1 , iff_2);
//SQUEEZE DOTS COLOR
sq_color = iff(HighSqz , orange ,IFf(MidSqz , red ,IFf(LowSqz , black , green)));
//PLOTS
plot1(mom, "MOM",mom_color);
plot2(0, "SQZ", sq_color);
2024-10-10
826
글번호 183820