답변완료
파라볼릭 쌍바닥 조건
Input : af(0.02), maxAF(0.2);
var :cSarv(0), T(0),B(0),S(0),tx(0),HH(0),LL(0),box(0),TL(0);
var : Z(0),dd(0),tt(0);
var1 = CSar(af,maxAF);
plot1(var1, "CSAR",IFF(c>var1,Red,Blue));
cSarv = csar(af,maxAF);
If crossup(c,cSarv) Then
{
var1 = cSarv;
Var2 = var1[1];
if var1 <= var2+PriceScale*2 and var1 >= var2-PriceScale*2 and var2 > 0 Then
{
Tx = Text_New(sDate,sTime,var1-0.05,"●");
Text_SetColor(Tx,Magenta);
Text_SetStyle(Tx,2,2);
Text_SetSize(Tx,15);
}
}
If CrossDown(c,cSarv) Then
{
var3 = csarv;
Var4 = var3[1];
if var3 <= var4+PriceScale*1 and var3 >= var4-PriceScale*1 and var4 > 0 Then
{
Tx = Text_New(sDate,sTime,var3+0.05,"●");
Text_SetColor(Tx,Blue);
Text_SetStyle(Tx,2,2);
Text_SetSize(Tx,15);
}
}
var5 = CSar(af,maxAF);
if CrossUp(C,var5) Then
{
T = 1;
B = var5;
HH = H;
dd = sDate;
tt = sTime;
box = Box_New(sDate,sTime,B,NextBarSdate,NextBarStime,HH);
}
if CrossDown(C,var5) Then
{
T = -1;
S = var5;
LL = L;
dd = sDate;
tt = sTime;
box = Box_New(sDate,sTime,S,NextBarSdate,NextBarStime,LL);
}
if T == 1 Then
{
if var5 < B Then
{
B = var5;
box_SetBegin(box,dd,tt,S);
}
if H > HH Then
HH = H;
Box_SetEnd(box,NextBarSdate,NextBarStime,hh);
if HH < B+0.6 Then
{
Box_SetColor(box,Orange);
Box_SetFill(box,true,120);
}
Else if HH >= B+0.6 and HH < B+0.8 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,80);
}
Else if HH >= B+0.8 and HH < B+1.3 Then
{
Box_SetColor(box,Magenta);
Box_SetFill(box,true,60);
}
Else if HH >= B+1.3 and HH < B+1.9 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,60);
}
Else
{
Box_SetColor(box,Pink);
Box_SetFill(box,true,90);
}
}
if T == -1 Then
{
if var5 > S Then
{
S = var5;
box_SetBegin(box,dd,tt,S);
}
if L < LL Then
LL = L;
Box_SetEnd(box,NextBarSdate,NextBarStime,LL);
if LL > S-0.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.6 and ll > S-0.8 Then
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.8 and ll > S-1.3 Then
{
Box_SetColor(box,Lime);
Box_SetFill(box,true,120);
}
Else if LL <= S-1.3 and ll > S-1.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,90);
}
Else if LL <= S-1.6 and ll > S-1.9 Then
{
Box_SetColor(box,Blue);
Box_SetFill(box,true,30);
}
Else
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,120);
}
}
쌍바닥 쌍봉 수식에 단순하게 박스 수식을 더했더니, 쌍바닥에 오류가 많이 나옵니다.
수정 부탁 드립니다.
추가로 쌍바닥 쌍봉 조건을,
직전 100개 봉의 최고가에서, 0.8 아래에서만 동그라미 표시로 수정. (H100-0.8)
쌍봉은 반대로 직전 100개 봉의 최저가에서, 0.8 위에서만 쌍봉일 때 표시. 감사합니다.
2024-07-24
892
글번호 181825
지표
답변완료
예스랭귀지로 변환부탁드립니다
아래는 전월고가돌파, 전월종가돌파, 당월시가돌파 의 키움수식입니다.
3종의 예스랭귀지로 변환 부탁드립니다.
[전월고가돌파]
A1 = floor(date / 100);
A2 = A1 % 100;
A3 = HighestSince(1,A2 !=A2(1) && A2 != 12, H);
A4 = Valuewhen(1, A2 != A2(1), A3(1))
Crossup(c,A4)
[전월종가돌파]
A1 = floor(date / 100);
A2 = A1 % 100;
A3 = HighestSince(1,A2 !=A2(1) && A2 != 12, C);
A4 = Valuewhen(1, A2 != A2(1), A3(1))
Crossup(c,A4)
[당월시가돌파]
A = floor(date / 100);
A2 = A% 100;
A3 = ValueWhen(1, A2!=A2(1), O)
Crossup(c,A3)
또한, 수식으로 전월평균고가를 어떻게 표현하면되나요?
2024-07-23
701
글번호 181820
종목검색
답변완료
문의 드립니다.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © FX365_Thailand
//Revision history
//v100.0 First release
//v101.0 Added alert conditions for swing high/low creation
//v107.0 Added alert conditions for liquidity raid
//v110.0 20240119
// Added an option to display liquidity pools
//@version=5
indicator('Liquidity Pools', shorttitle='Liquidity Pools(SABAI SABAI FX)', max_lines_count=500,overlay=true)
//Users' input ------
len_l = input.int(4, 'Left bar&Right bar', minval=1,group="Swing High Low Setting")
flg_shsl = input.bool(true, 'Show Swing High Swing Low')
flg_lq = input.bool(true, 'Show Liquidity Pools',group="Liquidity Pools Settings")
i_width = input.int(1, 'Line Width', minval=1,maxval=6)
i_linestyle = input.string(defval=line.style_dotted,options=[line.style_solid,line.style_dashed,line.style_dotted],title="Line Style")
i_linecolor_bs = input.color(color.new(#ff5252,65),title="Buy Side Liquidity Color")
i_linecolor_ss = input.color(color.new(#0ef30e,65),title="Sell Side Liquidity Color")
h = high
l = low
//Identify swingh high/low -----
swing_h = barstate.isconfirmed ? ta.pivothigh(h, len_l, len_l) : na
swing_l = barstate.isconfirmed ? ta.pivotlow(l, len_l, len_l) : na
//Value of Swing High/Swing Low
LSH = ta.valuewhen(swing_h, high[len_l], 0)
LSL = ta.valuewhen(swing_l, low[len_l], 0)
plotshape(flg_shsl ? swing_h : na, color=color.new(color.gray, 0), style=shape.labeldown, title='Swing High', text='SH', textcolor=color.new(color.white, 0), location=location.abovebar, offset=-len_l,size=size.tiny)
plotshape(flg_shsl ? swing_l : na, color=color.new(color.gray, 0), style=shape.labelup, title='Swing Low', text='SL', textcolor=color.new(color.white, 0), location=location.belowbar, offset=-len_l,size=size.tiny)
//Draw liquidity pools
//Variables
var line lin_BSLQ_upper = na
var line lin_BSLQ_lower = na
var line lin_SSLQ_upper = na
var line lin_SSLQ_lower = na
//Threshold
thresh = timeframe.isseconds ? 1.0001 : (timeframe.period == "60" and timeframe.period=="240") ? 3 : (timeframe.isminutes and timeframe.period != "60" and timeframe.period != "240") ? 1.0001 : timeframe.isdaily ? 1.005 : timeframe.isweekly ? 1.01 : timeframe.ismonthly ? 1.01 : 1.001
thresh_ = timeframe.isseconds ? 0.9999 : (timeframe.period == "60" and timeframe.period=="240") ? 3 : (timeframe.isminutes and timeframe.period != "60" and timeframe.period != "240") ? 0.9999 : timeframe.isdaily ? 0.995 : timeframe.isweekly ? 0.99 : timeframe.ismonthly ? 0.99 : 0.999
//Lines
if swing_h
lin_BSLQ_lower := flg_lq ? line.new(x1=bar_index-len_l,x2=bar_index, y1=LSH,y2=LSH,color=i_linecolor_bs,style= i_linestyle,width = i_width) : na
if swing_h
lin_BSLQ_upper := flg_lq ? line.new(x1=bar_index-len_l,x2=bar_index, y1=LSH*thresh,y2=LSH*thresh,color=i_linecolor_bs,style= i_linestyle,width = i_width) : na
if swing_l
lin_SSLQ_lower := flg_lq ? line.new(x1=bar_index-len_l,x2=bar_index, y1=LSL*thresh_,y2=LSL*thresh_,color=i_linecolor_ss,style=i_linestyle,width = i_width) : na
if swing_l
lin_SSLQ_upper := flg_lq ? line.new(x1=bar_index-len_l,x2=bar_index, y1=LSL,y2=LSL,color=i_linecolor_ss,style= i_linestyle,width = i_width) : na
//Fill
linefill.new(lin_BSLQ_upper,lin_BSLQ_lower,color=i_linecolor_bs)
linefill.new(lin_SSLQ_upper,lin_SSLQ_lower,color=i_linecolor_ss)
//Alert conditions
//Swing high low creation
alertcondition(swing_h,message="Swing High Created", title="Swing High")
alertcondition(swing_l,message="Swing Low Created", title="Swing Low")
//Reach liquidity zone
alertcondition(ta.crossover(high,LSH),message="Price reached buy side liquidity", title="Buy Side Liquidity Raid")
alertcondition(ta.crossunder(low,LSL),message="Price reached sell side liquidity", title="Sell Side Liquidity Raid")
트레이딩뷰 지표인데 예스로 좀 바꿔주세요.
2024-07-23
919
글번호 181818
지표