예스스탁
예스스탁 답변
2025-07-09 12:54:09
안녕하세요
예스스탁입니다.
지표식만 올리시면 저희가 어떤 조건으로 종목을 검색하고자 하시는지 알수 없습니다.
▲▲▲표시가 시작된 봉을 찾는 내용으로 작성해 드립니다.
종목검색식과 같이 조건을 체크하는 수식들은
조건 내용을 명확히 올려주시기 바랍니다.
input : length_low(72);
input : length_high(36);
input : refit_interval(50);
input : vol_period(20);
input : vol_smooth_len(5);
input : bull_col(BluE);
input : bear_col(red);
// ───── CCI-based Oscillator with Clipping ─────
var : raw1(0),clipped1(0),osc_low(0);
var : raw2(0),clipped2(0),osc_high(0);
raw1 = cci(length_low);
clipped1 = max(min(raw1, 100), -100);
osc_low = clipped1 / 200 + 0.5;
raw2 = cci(length_high);
clipped2 = max(min(raw2, 100), -100);
osc_high = clipped2 / 200 + 0.5;
// ───── Volatility Calculations ─────
var : returns(0),vol_current_raw(0),vol_current_smoothed(0);
returns = close / close[1] - 1;
vol_current_raw = std(returns, vol_period);
vol_current_smoothed = ma(vol_current_raw, vol_smooth_len);
// ───── Volatility History Management ─────
var : i(0),ii(0);
Array : vola[150](Nan);
if IsNan(vol_current_raw) == False Then
{
ii = 0;
For i = 149 DownTo 1
{
vola[i] = vola[i-1];
if IsNan(vola[i]) == true Then
ii = i;
}
vola[0] = vol_current_raw;
}
var : c1(Nan),c2(Nan),val(0),temp(0);
var : median(0),sum_low(0),count_low(0),sum_high(0),count_high(0);
if ii < 10 Then
{
c1 = Nan;
c2 = Nan;
}
Else
{
median = MedianArray(vola,ii);
sum_low = 0.0;
count_low = 0;
sum_high = 0.0;
count_high = 0;
for i = 0 to ii - 1
{
val = vola[i];
if val < median Then
{
sum_low = sum_low + val;
count_low = count_low + 1;
}
else
{
sum_high = sum_high + val;
count_high = count_high + 1;
}
}
c1 = iff(count_low > 0 , sum_low / count_low , Nan);
c2 = iff(count_high > 0 , sum_high / count_high , Nan);
}
// ───── Volatility Regime Variables (with type) ─────
var : cluster_1(Nan),cluster_2(Nan),last_refit_bar(Nan),vol_regime(Nan);
if index - last_refit_bar >= refit_interval and ii >= 149 Then
{
if IsNan(c1) == False and IsNan(c2) == False Then
{
cluster_1 = iff(IsNan(cluster_1) == true , c1 , cluster_1 + 0.1 * (c1 - cluster_1));
cluster_2 = iff(IsNan(cluster_2) == true , c2 , cluster_2 + 0.1 * (c2 - cluster_2));
last_refit_bar = index;
}
if cluster_1 > cluster_2 Then
{
temp = cluster_1;
cluster_1 = cluster_2;
cluster_2 = temp;
}
}
var : mid(0),relevant_osc(0),trend_regime(Nan);
if IsNan(vol_current_smoothed) == False and IsNan(cluster_1) == False and IsNan(cluster_2) == False Then
{
mid = (cluster_1 + cluster_2) / 2;
vol_regime = iff(vol_current_smoothed < mid , 0 , 1);
}
// ───── Oscillator S e l e c t i o n ─────
relevant_osc = iff(vol_regime == 1 , osc_high , osc_low);
// ───── Trend Regime Detection ─────
trend_regime = iff(relevant_osc > 0.75 , 1 , iff(relevant_osc < 0.25 , -1 , 0));
var : tx(0),box(0);
if trend_regime == 1 Then
{
if trend_regime[1] != 1 Then
{
Find(1);
}
}
즐거운 하루되세요
> 뽀스뽀스 님이 쓴 글입니다.
> 제목 : 종목검색식으로 바꿔 주세요
> 건강하세요 30분봉에서 사용 할깨요
input : length_low(72);
input : length_high(36);
input : refit_interval(50);
input : vol_period(20);
input : vol_smooth_len(5);
input : bull_col(BluE);
input : bear_col(red);
// ───── CCI-based Oscillator with Clipping ─────
var : raw1(0),clipped1(0),osc_low(0);
var : raw2(0),clipped2(0),osc_high(0);
raw1 = cci(length_low);
clipped1 = max(min(raw1, 100), -100);
osc_low = clipped1 / 200 + 0.5;
raw2 = cci(length_high);
clipped2 = max(min(raw2, 100), -100);
osc_high = clipped2 / 200 + 0.5;
// ───── Volatility Calculations ─────
var : returns(0),vol_current_raw(0),vol_current_smoothed(0);
returns = close / close[1] - 1;
vol_current_raw = std(returns, vol_period);
vol_current_smoothed = ma(vol_current_raw, vol_smooth_len);
// ───── Volatility History Management ─────
var : i(0),ii(0);
Array : vola[150](Nan);
if IsNan(vol_current_raw) == False Then
{
ii = 0;
For i = 149 DownTo 1
{
vola[i] = vola[i-1];
if IsNan(vola[i]) == true Then
ii = i;
}
vola[0] = vol_current_raw;
}
var : c1(Nan),c2(Nan),val(0),temp(0);
var : median(0),sum_low(0),count_low(0),sum_high(0),count_high(0);
if ii < 10 Then
{
c1 = Nan;
c2 = Nan;
}
Else
{
median = MedianArray(vola,ii);
sum_low = 0.0;
count_low = 0;
sum_high = 0.0;
count_high = 0;
for i = 0 to ii - 1
{
val = vola[i];
if val < median Then
{
sum_low = sum_low + val;
count_low = count_low + 1;
}
else
{
sum_high = sum_high + val;
count_high = count_high + 1;
}
}
c1 = iff(count_low > 0 , sum_low / count_low , Nan);
c2 = iff(count_high > 0 , sum_high / count_high , Nan);
}
// ───── Volatility Regime Variables (with type) ─────
var : cluster_1(Nan),cluster_2(Nan),last_refit_bar(Nan),vol_regime(Nan);
if index - last_refit_bar >= refit_interval and ii >= 149 Then
{
if IsNan(c1) == False and IsNan(c2) == False Then
{
cluster_1 = iff(IsNan(cluster_1) == true , c1 , cluster_1 + 0.1 * (c1 - cluster_1));
cluster_2 = iff(IsNan(cluster_2) == true , c2 , cluster_2 + 0.1 * (c2 - cluster_2));
last_refit_bar = index;
}
if cluster_1 > cluster_2 Then
{
temp = cluster_1;
cluster_1 = cluster_2;
cluster_2 = temp;
}
}
var : mid(0),relevant_osc(0),trend_regime(Nan);
if IsNan(vol_current_smoothed) == False and IsNan(cluster_1) == False and IsNan(cluster_2) == False Then
{
mid = (cluster_1 + cluster_2) / 2;
vol_regime = iff(vol_current_smoothed < mid , 0 , 1);
}
// ───── Oscillator S e l e c t i o n ─────
relevant_osc = iff(vol_regime == 1 , osc_high , osc_low);
// ───── Trend Regime Detection ─────
trend_regime = iff(relevant_osc > 0.75 , 1 , iff(relevant_osc < 0.25 , -1 , 0));
// ───── Plots ─────
PlotBaseLine1(0.5, "Mid", gray);
PlotBaseLine2(-0.2,"-0.2", Gray);
PlotBaseLine3(1.2,"1.2",Gray);
plot1(osc_low, "Slow CCI", iff(osc_low >= 0.5 , bull_col , bear_col));
plot2(osc_high, "Fast CCI", iff(osc_high >= 0.5 , bull_col , bear_col));
var : tx(0),box(0);
if trend_regime == 1 Then
{
if trend_regime[1] != 1 Then
{
tx = Text_New_Self(sDate,sTime,1.2,"▲▲▲");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,bull_col);
box = Box_New_Self(sDate,sTime,1.2,NextBarSdate,NextBarStime,-0.2);
Box_SetColor(box,bull_col);
Box_SetFill(box,true);
}
Else
Box_SetEnd(box,NextBarSdate,NextBarStime,-0.2);
}
if trend_regime == -1 Then
{
if trend_regime[1] != -1 Then
{
tx = Text_New_Self(sDate,sTime,-0.2,"▼▼▼");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,bear_col);
box = Box_New_Self(sDate,sTime,1.2,NextBarSdate,NextBarStime,-0.2);
Box_SetColor(box,bear_col);
Box_SetFill(box,true);
}
Else
Box_SetEnd(box,NextBarSdate,NextBarStime,-0.2);
}