답변완료
전략작성등
수고많으십니다 아래 세가지 요청건 부탁드립니다^^
1.분봉 수식전환(지표 및 검색수식)
기준봉=date!=date(1)&&predayclose()*1.05;
매수선=valuewhen(1,기준봉,(h+l)/1.9);
if(countsince(기준봉,date!=date(1)==1,매수선,0);
돌파=CrossUp(C,매수선)&&C<predayclose()*1.15;
조건=countsince(date!=date(1),돌파);
조건==1&&조건(1)==0
2.분봉 수식작성(지표 및 종목검색수식)
가.ma(c,5)<ma(c,20) //1봉전 한60~90일기간(분봉캔들 60~90개정도)5일선 20일선 역배열상태의미
나.CrossUp(ma(c,5),ma(c,20))&& ma(c,5)>ma(c,20)>ma(c,120)//0봉전(당일)5일선이 20일선 돌파 및 정배열전환
다.CrossUp(C,max(선행스팬1,선행스팬2))//가나다 동시돌파
3.분봉에서 (지표및 검색수식)
가.120일선 아래서//C<Ma(C,120); 이게 맞는지요??
나.CrossDown(RSI(14),30)//RSI(14)가 30 아래로 하향돌파
다.cnt=countsince(date!=date(1),나);
cnt==1&&cnt(1)==0
감사드립니다
2025-02-23
440
글번호 188454
검색
답변완료
지표좀 수정 부탁 드립니다.(2건)
* 항상 많은 도움 고맙습니다.
* 지표 수정 좀 요청 드립니다
<요청1>
아래 수식에서 소리음 수정 좀 요청 드림니다. 소리가 안남니다.
## 강조
input : len(10),len2(10);
var : oo(0),cc(0),hh(0),ll(0);
var : haclose(0),haopen(0),hahigh(0),halow(0);
var : o2(0),c2(0),h2(0),l2(0);
oo=ema(open,len);
cc=ema(close,len);
hh=ema(high,len);
ll=ema(low,len);
haclose = (oo+hh+ll+cc)/4;
haopen = iff(IsNaN(haopen[1]) == true,(oo + cc)/2 , (haopen[1] + haclose[1]) / 2);
hahigh = max(h, max(haopen,haclose));
halow = min(l, min(haopen,haclose));
o2=ema(haopen, len2);
c2=ema(haclose, len2);
h2=ema(hahigh, len2);
l2=ema(halow, len2);
PlotPaintBar(h2,l2,c2,o2,"강조",IFf(C2>O2,Lime,Red));
{
PlotPaintBar(h2,l2,c2,o2,"강조",IFf(C2>O2,Rgb(255,0,0),Rgb(0,255,0)),Def,2);
if CountIf(var25 == var25[1],1) == 1 and var25 != var25[1] Then
PlaySound("C:KiwoomGlobalsoundsound1.wav");
}
여기에서 색상(Lime,Red)이 변경 될때
COUNDIF 로 1봉 까지만 소리음 나도록 수정좀 요청 드립니다.
<요청2> 수식 좀 부 탁 드림니다. (그림 첨부부분)
ㅇ 양봉박스 그리기
- 이전 200봉(변수) 기준
- 양봉의 긴몸통 봉 이 발생 하면(30틱이상(변수), 꼬리제외)(그림1)
- 긴몸통의 전봉 고점과 다음봉 저점을 박스로 표현(그림2)
→ 전봉과 다음봉은 음봉 양봉 관계 없음
→ 전봉과 다음봉이 겹칠수 있기에 전봉 고가 기준 기본 10틱 박스그리기 기본
- 박스길이는 다음가격이 박스권 하단 보다 작으면 박스 종료(사진2)
* 박스채우기 색상: RGB(255,255,0)
박스선 색상 : RGB(255,0,0)
박스선 굵기 : 2
ㅇ 음봉박스 그리기
- 이전 200봉(변수) 기준
- 음봉의 긴몸통 봉 이 발생 하면(30틱이상(변수), 꼬리제외)(그림1)
- 긴몸통의 전봉 고점과 다음봉 저점을 박스로 표현(그림2)
→ 전봉과 다음봉은 음봉 양봉 관계 없음
→ 전봉과 다음봉이 겹칠수 있기에 전봉 고가 기준 기본 10틱 박스그리기 기본
- 박스길이는 다음가격이 박스권 하단 보다 작으면 박스 종료(사진2)
* 박스채우기 색상: RGB(0,255,0)
박스선 색상 : RGB(255,0,0)
빅스선 굵기 : 2
* 항상 큰 도움에 고맙습니다. 수고하십시요.
2025-02-24
471
글번호 188451
지표
답변완료
수식 부탁드립니다.
항상 도움주셔서 감사합니다.
트레이딩뷰에 있는 선행예상지표입니다.
예스트레이더 지표수식과 종목검색 부탁드립니다.
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo
//@version=5
indicator("Echo Forecast [LuxAlgo]","LuxAlgo - ECHO", overlay = true, max_bars_back = 1000, max_lines_count = 200)
//-----------------------------------------------------------------------------}
//Settings
//-----------------------------------------------------------------------------{
length = input.int(50, 'Evaluation Window', minval = 0, maxval = 200)
fcast = input.int(50, 'Forecast Window', minval = 1, maxval = 200)
fmode = input.string('Similarity', 'Forecast Mode', options = ['Similarity','Dissimilarity'])
cmode = input.string('Cumulative', 'Forecast Construction', options = ['Cumulative','Mean','Linreg'])
src = input(close)
//Style
fcastCss = input(#2157f3, 'Forecast Style', inline = 'fcast_style', group = 'Style')
fcastStyle = input.string('· · ·', '', options = ['──','- - -','· · ·'], inline = 'fcast_style', group = 'Style')
showArea = input(true,'Show Area', inline = 'areas', group = 'Style')
refArea = input(color.new(#ff5d00, 80), '', inline = 'areas', group = 'Style')
corrArea = input(color.new(#089981, 80), '', inline = 'areas', group = 'Style')
evalArea = input(color.new(color.gray, 80),'', inline = 'areas', group = 'Style')
//-----------------------------------------------------------------------------}
//Populate line arrays
//-----------------------------------------------------------------------------{
var lines = array.new_line(0)
if barstate.isfirst
for i = 0 to fcast-1
array.push(lines,line.new(na,na,na,na
, style = fcastStyle == '- - -' ? line.style_dashed : fcastStyle == '· · ·' ? line.style_dotted : line.style_solid
, color = fcastCss))
//-----------------------------------------------------------------------------}
//Calculations
//-----------------------------------------------------------------------------{
var eval_window = box.new(na,na,na,na,na, bgcolor = evalArea)
var ref_window = box.new(na,na,na,na,na, bgcolor = refArea)
var corr_window = box.new(na,na,na,na,na, bgcolor = corrArea)
n = bar_index
d = src - src[1]
//Get range maximum/minimum
top = ta.highest(src, length + fcast * 2)
btm = ta.lowest(src, length + fcast * 2)
//Set forecast
if barstate.islast
k = 0
float val = na
A = array.new_float(0) //Calculation window
X = array.new_int(0) //Linreg independant variable
//Populate calculation window
for i = 0 to fcast*2+length
A.push(src[i])
//Populate independant variable array
if cmode == 'Linreg'
X.push(n[i])
a = A.slice(0, fcast-1) //Reference window
//Find window to produce forecast
for i = 0 to length-1
b = A.slice(fcast + i, fcast * 2 + i - 1) //Evaluation window
r = a.covariance(b) / (a.stdev() * b.stdev()) //Correlation
//Maximization or minimization problem
if fmode == 'Similarity'
val := r >= nz(val, r) ? r : val
else
val := r <= nz(val, r) ? r : val
k := val == r ? i : k
//Set ECHO
prev = src
current = src
for i = 0 to fcast-1
e = d[fcast + k + (fcast-i-1)]
//Get forecast point
if cmode == 'Mean'
current := array.avg(a) + e
else if cmode == 'Linreg'
a = A.slice(0, fcast)
x = X.slice(0, fcast)
alpha = a.covariance(x) / x.variance()
beta = a.avg() - alpha * x.avg()
current := alpha * (n + i + 1) + beta + e
else
current += e
l = lines.get(i)
l.set_xy1(n+i, prev)
l.set_xy2(n+i+1, current)
prev := current
//Set areas
if showArea
//Evaluation window
eval_window.set_lefttop(n-length-fcast*2+1, top)
eval_window.set_rightbottom(n-fcast+1, btm)
//Reference window
ref_window.set_lefttop(n-fcast+1, top)
ref_window.set_rightbottom(n, btm)
//Correlation window
corr_window.set_lefttop(n-k-fcast*2+1, top)
corr_window.set_rightbottom(n-k-fcast, btm)
//-----------------------------------------------------------------------------}
부탁드립니다.
2025-02-22
534
글번호 188446
지표