답변완료
2개 수식 부탁드립니다.
1번 사진에 있는 수식
예스로 변환해서 종목검색 하고 싶습니다.
2번 강조수식을 종목검색으로 변환하고 싶습니다.
하늘색강조에서 빨간색 강조로 바뀔때를 검색하려고 합니다.
일봉시점으로 부탁드립니다.
input : MaPeriod(2),MaPeriod2(1);
var : maOpen(0),maClose(0),maLow(0),maHigh(0);
var : haOpen(0),haClose(0),haLow(0),haHigh(0);
var : ExtMapBuffer1(0),ExtMapBuffer2(0),ExtMapBuffer3(0),ExtMapBuffer4(0);
var : ExtMapBuffer5(0),ExtMapBuffer6(0),ExtMapBuffer7(0),ExtMapBuffer8(0);
var : r(0),g(0),b(0), TL(0);
if Index == 0 Then
{
maOpen=Open;
maClose=Close;
maLow=Low;
maHigh=High;
}
Else
{
maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod;
maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod;
maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod;
maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod;
haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2;
haClose=(maOpen+maHigh+maLow+maClose)/4;
haHigh=Max(maHigh, Max(haOpen, haClose));
haLow=Min(maLow, Min(haOpen, haClose));
if (haOpen<haClose) then
{
r=255;
g=10;
b=0;
ExtMapBuffer7=haLow;
ExtMapBuffer8=haHigh;
}
else
{
r=0;
g=191;
b=255;
ExtMapBuffer7=haHigh;
ExtMapBuffer8=haLow;
}
ExtMapBuffer5=haOpen;
ExtMapBuffer6=haClose;
ExtMapBuffer1=WMA(ExtMapBuffer7,MAperiod2);
ExtMapBuffer2=WMA(ExtMapBuffer8,MAperiod2);
ExtMapBuffer3=WMA(ExtMapBuffer5,MAperiod2);
ExtMapBuffer4=WMA(ExtMapBuffer6,MAperiod2);
}
PlotPaintBar(ExtMapBuffer2,ExtMapBuffer1,ExtMapBuffer3,ExtMapBuffer4,"강조",Rgb(r,g,b));
부탁드립니다.
2023-11-16
866
글번호 174131
종목검색
답변완료
문의 드립니다.
indicator('Beardy Squeeze Pro', shorttitle='Squeeze', overlay=false, precision=2)
length = input.int(20, "TTM Squeeze Length")
//BOLLINGER BANDS
BB_mult = input.float(2.0, "Bollinger Band STD Multiplier")
BB_basis = ta.sma(close, length)
dev = BB_mult * ta.stdev(close, length)
BB_upper = BB_basis + dev
BB_lower = BB_basis - dev
//KELTNER CHANNELS
KC_mult_high = input.float(1.0, "Keltner Channel #1")
KC_mult_mid = input.float(1.5, "Keltner Channel #2")
KC_mult_low = input.float(2.0, "Keltner Channel #3")
KC_basis = ta.sma(close, length)
devKC = ta.sma(ta.tr, 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 = ta.linreg(close - math.avg(math.avg(ta.highest(high, length), ta.lowest(low, length)), ta.sma(close, length)), length, 0)
//MOMENTUM HISTOGRAM COLOR
iff_1 = mom > nz(mom[1]) ? color.new(color.aqua, 0) : color.new(#2962ff, 0)
iff_2 = mom < nz(mom[1]) ? color.new(color.red, 0) : color.new(color.yellow, 0)
mom_color = mom > 0 ? iff_1 : iff_2
//SQUEEZE DOTS COLOR
sq_color = HighSqz ? color.new(color.orange, 0) : MidSqz ? color.new(color.red, 0) : LowSqz ? color.new(color.black, 0) : color.new(color.green, 0)
//ALERTS
Detect_Sqz_Start = input.bool(true, "Alert Price Action Squeeze")
Detect_Sqz_Fire = input.bool(true, "Alert Squeeze Firing")
if Detect_Sqz_Start and NoSqz[1] and not NoSqz
alert("Squeeze Started")
else if Detect_Sqz_Fire and NoSqz and not NoSqz[1]
alert("Squeeze Fired")
//PLOTS
plot(mom, title='MOM', color=mom_color, style=plot.style_columns, linewidth=2)
plot(0, title='SQZ', color=sq_color, style=plot.style_circles, linewidth=3)
트레이딩뷰 지표인데 예스로 좀 변환해주세요.
2023-11-16
1093
글번호 174101
지표
답변완료
도움을 요청합니다.
안녕하세요..
아래 수식은 참조데이터 2와 3을 결합하여 나타내는 수식입니다.
참조데이터 4를 추가해주시기를 요청드립니다.
결과적으로 참조데이터2+3+4를 원하는 것입니다.
노고에 미리 감사드립니다.
==================
var : O2(0,data3),C2(0,Data3),H2(0,Data3),L2(0,Data3),cnt(0,Data3);
var : Sidx(0,Data3),Sidx1(0,Data3),Eidx(0,Data3),Eidx1(0,Data3),Pre1(0,Data3);
C2 = Data3(c)+data4(c);
if Data3(Bdate != Bdate[1]) Then
{
o2 = c2;
H2 = C2;
L2 = C2;
Sidx = data3(Index);
Sidx1 = Sidx[1];
Eidx1 = Eidx[1];
}
Eidx = data3(Index);
if data3(Bdate != Bdate[1] or (Bdate == bdate[1] and C2 > h2)) Then
h2 = C2;
if data3(Bdate != Bdate[1] or (Bdate == Bdate[1] and C2 < l2)) Then
l2 = C2;
if Sidx1 > 0 Then
{
pre1 = 0;
For cnt = data3(Index)-Eidx1 to data3(Index)-Sidx1
{
if data3(sDate[cnt] < sDate and sTime[cnt] <= sTime) Then
{
pre1 = C2[cnt];
cnt = data3(Index-Sidx1+1);
}
}
}
if CurrentDate == sDate Then
{
if Data1(sDate) == Data3(sDate) Then
{
Plot1(C2,"참조",IFf(C2 >0,RGB(0,0,0),RGB(0,0,0)));
Plot2(H2,"최고");
Plot3(L2,"최저");
Plot4(pre1,"전일");
PlotBaseLine1(0);
}
Else
{
NoPlot(1);
NoPlot(2);
NoPlot(3);
NoPlot(4);
}
}
if CurrentDate == sDate and Data1(sDate) == Data3(sDate) Then
{
Plot5(C2,"D2당일시가");
Plot6(h2,"D2당일고가");
Plot7(L2,"D2당일저가");
Plot8(L2+(H2-L2)*0.25,"25.0%");
Plot9(L2+(H2-L2)*0.75,"75.0%");
Plot10(L2+(H2-L2)*0.382,"38.2%");
Plot11(L2+(H2-L2)*0.618,"61.8%");
Plot12(L2+(H2-L2)*0.50,"50.0%");
}
if CurrentDate == sDate and Data1(sDate) == Data3(sDate) Then
Plot13(O2,"당일시가");
2023-11-16
789
글번호 174099
지표