답변완료
화살표생성
안녕하세요 관리자님!!
아래지표에서
음봉이 plot19를 하방으로 뚫고 확정된 봉이 됐을때 ↑
양봉이 plot16을 상방으로 뚫고 확정된 봉이 됐을때 ↓
표시될수 있도록 추가하여 주시길 바랍니다^^
-아 래-
input : nday(2);
var : OO(0),HH(0),LL(0),cnt(0);
OO = DayOpen(nday);
HH = DayHigh(1);
LL = DayLow(1);
for cnt = 1 to nday
{
if DayHigh(cnt) > hh Then
hh = DayHigh(cnt);
if DayLow(cnt) < ll Then
ll = DayLow(cnt);
}
if OO > 0 then
{
var1 = C/OO*100-100;
plot1(var1,"시가");
}
if HH > 0 then
{
var2 = (C/HH*100-100);
plot2(var2,"고가");
}
if LL > 0 then
{
var3 = C/LL*100-100;
plot3(var3,"저가");
plot4(0,"0선");
plot5(-var2,"-고가");
plot6(-var3,"-저가");
plot7(var3-var2,"저가-고가");
plot8(var2-var3,"고가-저가");
plot9(0.5,"0.5선");
plot10(-0.5,"-0.5선");
plot11(1.0,"1.0선");
plot12(-1.0,"-1.0선");
plot13(2.0,"2.0선");
plot14(-2.0,"-2.0선");
plot15(HH*1.005,"저0.5선");
plot16(HH*1.01,"저1.0선");
plot17(HH*1.02,"저2선");
plot18(LL*0.995,"고-0.5선");
plot19(LL*0.99,"고-1.0선");
plot20(LL*0.98,"고-2선");
plot21(HH*1.0,"저0선");
plot22(LL*1.0,"고0선");
}
2024-10-24
576
글번호 184582
지표
답변완료
강조 기능 좀 부탁 드립니다.
* 좋은주말 되십시요.
ㅇ 세계트레이딩대회 우승자의 초간단 매매법 공개합니다
ㅇ세계트레이딩대회 우승자의 초간단 매매법 공개합니다 500만원 → 10억, 선2개만 셋팅했는데 진짜 말도 안되는 일이 벌어졌습니다. (이건 무조건 따라하셔야 됩니다)
https://www.youtube.com/watch?v=6eVZC7ab6qs
ㅇ 두가지 요청 좀 드리겠습니다.
* 아래 기능 으로 수평선이 나오는데
봉길이(H+L)가 20틱 이상이며
양봉이면서 고가수평선을 양봉의 (H+L)/2 가격이 CROSSUP 되는 봉에 빨강 강조
음봉이면서 저가수평선을 음봉의 (H+L)/2 가격이 CROSSDOWN 되는 봉에 그린 강조
강조 수식 좀 부탁 드립니다.
##
input : P(2),n(7),틱(2), 굵기(1);
var : TX(0);
var : cnt(0),LL(0),HH(0);
Array : LTL[10](0),HTL[10](0);
var : LTL1(0),LTL2(0),LTL3(0),LTL4(0),LTL5(0),LTL6(0);
var : HTL1(0),HTL2(0),HTL3(0),HTL4(0),HTL5(0),HTL6(0);
if L < Lowest(L,P)[1] and (LL == 0 or (LL > 0 and abs(L-LL) >= PriceScale*틱)) Then
{
LL = L+0.04;
For cnt = 9 DownTo 1
{
LTL[cnt] = LTL[cnt-1];
}
LTL[0] = TL_new(sDate,sTime,LL,NextBarSdate,NextBarStime,LL);
TL_SetColor(LTL[0],LGreen);
TL_SetSize(LTL[0],굵기);
TL_Delete(LTL[n]);
}
Else
{
TL_SetEnd(LTL[0],sDate,sTime,LL);
}
if H > highest(H,P)[1] and (HH == 0 or (HH > 0 and abs(H-HH) >= PriceScale*틱)) Then
{
HH = H-0.04;
For cnt = 9 DownTo 1
{
HTL[cnt] = HTL[cnt-1];
}
HTL[0] = TL_new(sDate,sTime,HH,NextBarSdate,NextBarStime,HH);
TL_SetColor(HTL[0],Red);
TL_SetSize(HTL[0],굵기);
TL_Delete(HTL[n]);
}
Else
{
TL_SetEnd(HTL[0],sDate,sTime,HH);
}
#3 2222
첨부 수식이 CrossUp, CROSSDOWN 자주 나오는데
10봉이내에 신호가 없어야 한다
수식좀 추가 요청 드립니다.
## 신호
var : TL1(0),TL2(0) ;
if CrossUp( VAR1 , VAR2) Then
{
##저가-1틱에서~0까지
TL2 = TL_New(sDate,sTime,L-PriceScale*5,sDate,sTime,L-PriceScale*80);
TL_SetColor(TL2,Rgb(255,0,0));
TL_SetSize(TL2,6);
TL2 = TL_New(sDate,sTime,L-PriceScale*5,sDate,sTime,L-PriceScale*80);
TL_SetColor(TL2,Rgb(0,255,0));
TL_SetSize(TL2,1);
}
좋은 주말 되십시요^^
2024-12-10
696
글번호 184581
강조
답변완료
수고하십니다
항상노고에 감사드리며 트레이딩뷰챠트인데 변환 부탁드립니다
주말 잘보내세요
/@version=5
indicator("DSL Trend Analysis [ChartPrime]", overlay = true)
// --------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// --------------------------------------------------------------------------------------------------------------------{
int len = input.int(10, "Length") // Length for calculating DSL
int offset = input(30, "Offset") // Offset for threshold levels
float width = input.float(1, "Bands Width", step = 0.1, maxval = 2, minval = 0.5) // Width for ATR-based bands
// Colors for upper and lower trends
color upper_col = input.color(color.lime, "+", inline = "col")
color lower_col = input.color(color.orange, "-", inline = "col")
// --------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{
// Function to calculate DSL lines based on price
dsl_price(float price, int len) =>
// Initialize DSL lines as NaN (not plotted by default)
float dsl_up = na
float dsl_dn = na
float sma = ta.sma(price, len)
// Dynamic upper and lower thresholds calculated with offset
float threshold_up = ta.highest(len)[offset]
float threshold_dn = ta.lowest(len)[offset]
// Calculate the DSL upper and lower lines based on price compared to the thresholds
dsl_up := price > threshold_up ? sma : dsl_up[1]
dsl_dn := price < threshold_dn ? sma : dsl_dn[1]
// Return both DSL lines
[dsl_up, dsl_dn]
// Function to calculate DSL bands based on ATR and width multiplier
dsl_bands(float dsl_up, float dsl_dn) =>
float atr = ta.atr(200) * width // ATR-based calculation for bands
float upper = dsl_up - atr // Upper DSL band
float lower = dsl_dn + atr // Lower DSL band
[upper, lower]
// Get DSL values based on the closing price
[dsl_up, dsl_dn] = dsl_price(close, len)
// Calculate the bands around the DSL lines
[dsl_up1, dsl_dn1] = dsl_bands(dsl_up, dsl_dn)
// Linear regression on the close price over a short period
float linreg = ta.linreg(close, 5, 0)
// Determine the trend color based on the relationship between price, DSL lines, and bands
color trend_col =
high > dsl_up1 and high < dsl_up and high > dsl_dn1
? color.new(upper_col, 60)
: low > dsl_dn and low < dsl_dn1
? color.new(lower_col, 60)
: high > dsl_up
? upper_col
: low < dsl_dn
? lower_col
: na
// --------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{
// Plot the linear regression with color based on trend analysis
plot(linreg, "Trend Line", color = trend_col, linewidth=4, style = plot.style_linebr, force_overlay = false)
// If it's the last bar, display labels for the DSL upper and lower bands
if barstate.islast
label.delete(label.new(bar_index + 5, dsl_up, "Upper Band₩n" + str.tostring(dsl_up, "#.##"), style = label.style_label_left, color = color(na), textcolor = chart.fg_color)[1])
label.delete(label.new(bar_index + 5, dsl_dn, "Lower Band₩n" + str.tostring(dsl_dn, "#.##"), style = label.style_label_left, color = color(na), textcolor = chart.fg_color)[1])
// Plot the DSL lines on the chart
pu = plot(dsl_up, color=color.gray, linewidth=1, title="DSL Up")
pd = plot(dsl_dn, color=color.gray, linewidth=1, title="DSL Down")
// Plot the DSL bands
pu1 = plot(dsl_up1, color=color.gray, linewidth=1, title="DSL Upper Band")
pd1 = plot(dsl_dn1, color=color.gray, linewidth=1, title="DSL Lower Band")
// Fill the space between the DSL lines and bands with color
fill(pu, pu1, dsl_up, dsl_up1, color.new(upper_col, 80), color.new(upper_col, 90))
fill(pd, pd1, dsl_dn, dsl_dn1, color.new(lower_col, 80), color.new(lower_col, 90))
// Uncomment the following line to plot candles with trend color
// plotcandle(open, high, low, close, title='Title', color = trend_col, wickcolor=trend_col, bordercolor = trend_col)
// --------------------------------------------------------------------------------------------------------------------}
2024-10-24
795
글번호 184562
지표
답변완료
추세전환 일정 크기 이상
input : Period(100);
Var:j(0),T(0),txx(0);
Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0),tx(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
Plot1(value12);
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];
TL_Delete(TL);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,Blue);
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
if abs(value12[1]-value11[1]) < 0.5 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);
}
If LoVal[0] > L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date22 = date[0];
time22 = stime[0];
Text_SetString(tx,NumToStr(value11-value12,2));
Text_SetLocation(tx,sDate,sTime,value12);
}
}
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];
TL_Delete(TL);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,Red);
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
if abs(value12[1]-value11[1]) < 0.5 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];
TL_SetEnd(TL1, date12,time12,Value12);
date32 = date[0];
time32 = stime[0];
Text_SetString(tx,NumToStr(value12-value11,2));
Text_SetLocation(tx,sDate,sTime,value12);
}
}
TL_SetSize(TL1,1);
0.5보다 작아도 조건만 맞으면 바뀌는 추세 전환을,
조건이 맞아도 강제로 보류하고 있다가,
새 추세선의 크기가 0.5 이상이 될 때, 추세 전환으로 변경.
즉 전환 조건에 새 추세선 크기가 0.5 이상일 때 추가. 감사합니다.
2024-10-24
767
글번호 184561
지표