답변완료
부틱드립니다
수고하십니다
아래수식을 오류 없게 수정부탁드립니다
//{ Chaikin Money Flow (CMF) Indicator }
Inputs:
Period(20); // CMF 계산 기간
Vars:
MFMultiplier(0),
MFVolume(0),
SumMFVolume(0),
SumVolume(0),
CMF(0),
Counter(0);
// Money Flow Multiplier 계산
If (High - Low) <> 0 Then
MFMultiplier = ((Close - Low) - (High - Close)) / (High - Low)
Else
MFMultiplier = 0;
// Money Flow Volume 계산
MFVolume = MFMultiplier * Volume;
// Period 동안의 합계 계산
SumMFVolume = 0;
SumVolume = 0;
For Counter = 0 To Period - 1 Begin
SumMFVolume = SumMFVolume + (MFMultiplier[Counter] * Volume[Counter]);
SumVolume = SumVolume + Volume[Counter];
End;
// CMF 계산
If SumVolume <> 0 Then
CMF = SumMFVolume / SumVolume
Else
CMF = 0;
// 플롯
Plot1(CMF, "CMF");
Plot2(0, "ZeroLine");
Plot3(0.25, "UpperLevel");
Plot4(-0.25, "LowerLevel");
// 색상 조건부 설정
If CMF > 0 Then
SetPlotColor(1, Green)
Else If CMF < 0 Then
SetPlotColor(1, Red);
답변완료
종목 검색식 부탁드립니다.
MA20=Ma(C,20,단순);
MA60=Ma(C,60,단순);
크로스횟수=Sum(If(CrossUp(MA20,MA60) or CrossDown(MA20,MA60),1,0),5);
ATR14=Avg((Highest(H,1)-Lowest(L,1)),14);
GapRatio=Abs(MA20-MA60)/ATR14;
급락=(Lowest(C,5)/C(5))<0.95;
크로스횟수<=1 && GapRatio>0.3 && !급락
위 수식을 예스랭귀지로 변환부탁드립니다.
답변완료
문의드립니다.
아래의 트레이딩뷰 수식을 변환부탁드립니다.
====================
//@version=6
indicator("VWAP Price Channel", "VPC", overlay = true)
///_____________________________________________________________________________________________________________________
///Inputs
///‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
tf = input.timeframe("", title = "Timeframe")
len = input.int(20, title = "Length", minval = 1)
///_____________________________________________________________________________________________________________________
///VWAP Price Channel Function
///‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
get_vpc(_len) =>
//Main Logic
var float h_vwap = high
var float l_vwap = low
float upper = na
float lower = na
hst = ta.highest(_len)
lst = ta.lowest(_len)
new_high = high == hst
new_low = low == lst
h_vwap := ta.vwap(high,new_high)
l_vwap := ta.vwap(low,new_low)
h_change = ta.change(h_vwap)
l_change = ta.change(l_vwap)
upper := new_high ? hst : (hst == hst[1] ? upper[1] + h_change : math.min(hst,upper[1] + h_change))
lower := new_low ? lst : (lst == lst[1] ? lower[1] + l_change : math.max(lst,lower[1] + l_change))
_avg = math.avg(upper,lower)
//Trend Detection & Coloring
var int dir = 0
var int dir2 = 0
dir := new_high?1:new_low?-1:0
dir2 := new_high?1:new_low?-1:dir2[1]
[upper,lower,_avg,hst,lst,dir,dir2]
//Calling Function
[upper,lower,mid,hst,lst,dir,dir2] = request.security("",tf,get_vpc(len))
///_____________________________________________________________________________________________________________________
///Display
///‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
u = plot(upper, title = "Upper", color = dir == 1 ? color.rgb(0,0,0,100):color.rgb(255, 3, 62), style = plot.style_linebr)
plot(mid, title = "Mid", color = color.gray, display = display.none)
l = plot(lower, title = "Lower", color = dir == -1 ? color.rgb(0,0,0,100):color.rgb(61, 170, 69), style = plot.style_linebr)
c = plot(close, display = display.none, editable = false)
fill(u,c,dir2 == 1?color.rgb(0,0,0,100):color.rgb(255, 3, 62, 95), title = "Fill")
fill(l,c,dir2 == -1?color.rgb(0,0,0,100):color.rgb(61, 170, 69, 95), title = "Fill")
plot(hst, title = "DC Upper", color = #004d92, display = display.none)
plot(lst, title = "DC Lower", color = #004d92, display = display.none)
//<---nice
======================================
항상 감사드립니다. 수고하세요!!!