답변완료
수식좀 요청 드립니다.
ㅇ항상 많은 도움에 고맙습니다.
ㅇ요청1:바이너리 지표를 스톡 으로 표현할수 있나요? 가능 하면 부탁 좀 드리겠습니다.
ㅇ아래 수식에서 스톡과 MACD를 "다음 항목과 공유" 하면 (사진1)
수치가 틀려서 거의 수평선으로 나옴니다. (사진2)
혹시 두수식 수치 차이가 커서 지표가 거의 수평선으로 나오는데
스톡 하고 같은 싸이클로 공유 할수 있나요?
##
input : 기간1(25),기간2(25);
var : ap(0),esa(0),d(0),ci(0),wt1(0),wt2(0);
ap = (HIGH+LOW+CLOSE)/3;
esa = Ema(ap, 기간1);
d = Ema(abs(ap - esa), 기간1);
ci = (ap - esa) / (0.015 * d);
wt1 = Ema(ci,기간2);
wt2 = ma(wt1,4);
Var21 = ma(wt1,기간1) ;
Var22 = ma(wt2,기간2) ;
Plot1(Var21,"11");
plot2(Var22,"22");
PlotBaseLine1(0,"0",Rgb(255,0,0),Def,0) ;
## MACD
Input : shortPeriod22(20), longPeriod22(60), Period22(20);
Var : MACDv22(0), MACDsig22(0),macdosc22(0) ;
MACDv22 = MACD(shortPeriod22, longPeriod22);
MACDsig22 = ema(MACDv22,Period22);
macdosc22 = MACDv22-ema(MACDv22,Period22);
var21 = ma(MACDv22 ,20 ) ;
var22 = ma(MACDv22 ,5 ) ;
var23 = ma(MACDv22 ,60 ) ;
var11 = ma(MACDv22 ,10 ) ;
var12 = ( VAR21 + Var22 + Var23 + Var11) / 3.5 ;
Plot41(var12 - PriceScale*0,"이격",IFF(var12 > var12[2] ,Rgb(255,0,255), Rgb(0,0,255)),Def,IFf(var12 < var12[2],3,3));
ㅇ 좋은 한주 되십시요. 고맙습니다.
2025-08-04
224
글번호 192939
지표
답변완료
지표 수식을 부탁합니다.
항상 노고에 감사드립니다.
다음 TV수식을 YT형식으로 부탁합니다. 개인적으로 해봤는데 PivotHigh, PivotLow에서 막히네요.
그리고 MidLine(avg)을 ① crossUp하거나 ② 위에서 1%이내로 근접하는 종목을 검색하는 식도 부탁드립니다.
//@version=6
indicator("#Step Channel Momentum Trend [ChartPrime]", overlay = true, max_labels_count = 500)
// -----------------------------------}
// USER INPUTS
// -----------------------------------{
len = input.int(3, "Length", tooltip = "Pivot Length")
mult = input.float(0.6, "Multiplier", step =0.1, tooltip = "Bands Multiplier")
color_t_up = input.color(color.rgb(202, 38, 65), "", inline = "Color", group = "Momentum Colors")
color_t = input.color(color.orange, "", inline = "Color", group = "Momentum Colors")
color_t_dn = input.color(color.rgb(26, 190, 127), "", inline = "Color", group = "Momentum Colors")
var p_h = float(na)
var p_l = float(na)
var trend = bool(na)
market_state = "Range"
// -----------------------------------}
// INDICATOR CALCUATIONS
// -----------------------------------{
ph = ta.pivothigh(len, len)
pl = ta.pivotlow(len, len)
if not na(ph)
p_h := ph
label.new(bar_index-len, ph, "☆", style = label.style_label_center, textcolor = color.white, size = size.normal, color = color.lime)
if not na(pl)
p_l := pl
label.new(bar_index-len, pl, "★", style = label.style_label_center, textcolor = color.white, size = size.normal, color = color.purple)
avg = math.avg(p_h, p_l)
atr = ta.atr(200)*mult
upper = avg + atr
lower = avg - atr
if hl2 > upper
color_t := color_t_up
trend := true
market_state := "Momentum Up"
if hl2 < lower
color_t := color_t_dn
trend := false
market_state := "Momentum Down"
// -----------------------------------}
// VISUALIZATIONS
// -----------------------------------{
plot(avg, "MidLine", color = color_t, linewidth = 3)
plot(upper, "Upper", color = chart.fg_color, style = plot.style_linebr)
plot(lower, "Lower", color = chart.fg_color, style = plot.style_linebr)
plotcandle(open, high, low, close, title='Momentum Candles', color = color_t, wickcolor=color_t, bordercolor = color_t)
if barstate.islast
label.delete(label.new(bar_index, close, market_state, color = color(na), textcolor = color_t, style = label.style_label_left, size = size.large)[1])
2025-08-02
260
글번호 192937
지표
답변완료
수식 부탁드립니다
타주기 적용 부탁드립니다.
input : vidya_length(100);
input : vidya_momentum(20);
input : band_distance(2);
input : up_trend_color(Green);
input : down_trend_color(Red);
input : shadow(true);
var : pivot_left_bars(3),pivot_right_bars(0),source(0);
var : pivot_line(Nan);
var : volume_value(Nan);
var : smoothed_value(Nan);
var : is_trend_up(False);
var : up_trend_volume(False);
var : down_trend_volume(Nan);
Array : liquidity_lines_low[500](0),liquidity_lines_high[500](0);
pivot_left_bars = 3;
pivot_right_bars = 3;
source = close;
var : al(0),atr_value(0);
al = 1/200;
atr_value = IFf(IsNan(atr_value[1]) == true,ma(TrueRange, 200) , al * TrueRange + (1 - al) * IFf(IsNaN(atr_value[1])==true,0,atr_value[1]));
var : momentum(0),sum_pos_momentum(0),sum_neg_momentum(0),abs_cmo(0),alpha(0),vidya_v(0),vidya_value(0);
momentum = source-source[1];
sum_pos_momentum = AccumN(IFf(momentum >= 0, momentum , 0), vidya_momentum);
sum_neg_momentum = AccumN(IFf(momentum >= 0, 0, -momentum), vidya_momentum);
abs_cmo = abs(100 * (sum_pos_momentum - sum_neg_momentum) / (sum_pos_momentum + sum_neg_momentum));
alpha = 2 / (vidya_length + 1);
vidya_v = alpha * abs_cmo / 100 * source + (1 - alpha * abs_cmo / 100) * iff(IsNan(vidya_v[1])==true,0,vidya_v[1]);
vidya_value = ma(vidya_v, 15);
var : upper_band(0),lower_band(0);
upper_band = vidya_value + atr_value * band_distance;
lower_band = vidya_value - atr_value * band_distance;
// Detect trend direction using crossovers of source with bands
if CrossUp(source, upper_band) Then
is_trend_up = true ;
if CrossDown(source, lower_band) Then
is_trend_up = false ;
// Set trend-based smoothing variable
if is_trend_up == true Then
smoothed_value = lower_band;
if is_trend_up == False Then
smoothed_value = upper_band;
if is_trend_up != is_trend_up[1] Then
smoothed_value = Nan;
// Calculate pivot highs and lows for price action
var : pivot_high(0),pivot_low(0);
pivot_high = SwingHigh(1,high,pivot_left_bars, pivot_right_bars,pivot_left_bars+pivot_right_bars+1);
pivot_low = SwingLow(1, close, pivot_left_bars, pivot_right_bars,pivot_left_bars+pivot_right_bars+1);
if smoothed_value > 0 Then
plot1(smoothed_value,"smoothed_value",iff(is_trend_up , up_trend_color ,down_trend_color));
Else
NoPlot(1);
var : tx(0);
if is_trend_up == is_trend_up[1] and is_trend_up[1] != is_trend_up[2] Then
{
if is_trend_up == true Then
{
tx = Text_New(sDate,sTime,smoothed_value,"▲");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,up_trend_color);
Text_SetSize(tx,20);
}
if is_trend_up == False Then
{
tx = Text_New(sDate,sTime,smoothed_value,"▼");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,down_trend_color);
Text_SetSize(tx,20);
}
}
2025-08-01
242
글번호 192936
지표
답변완료
문의
최초 문의를 진입필터라고 해서 혼선을 드린 것 같습니다.
특정 조건이 발생했을 때 b2 진입하는 방법을 하나 더 추가하는 건입니다.
b1 진입이 SetStopInactivity로 청산되는 경우에
b2 진입은 답변 수식처럼 진입하는 게 맞습니다.
b1 진입이 SetStopInactivity으로 청산되지 않는 경우는
b2 진입은 최초 수식대로 진입해야 합니다. 답변 수식으로는 이 때의 진입이 발생하지 않습니다.
순서도로 보자면
SetStopInactivity이 발생했을 때... b2 진입하는 방법과
SetStopInactivity이 발생하지 않을 때...b2 진입하는 방법(최초 수식)
2개가 필요합니다.
수정 부탁드립니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 문의
>
안녕하세요
예스스탁입니다.
input : b1(116);
input : b1ls(1.5),b1tr(2.7),mi1(0.5),bg1(150);
input : b2(122);
input : b2ls(2),b2tr(3.6),mi2(0),bg2(0);
var : T1(0),entry(0),LL(0),EH(0);
if Bdate != Bdate[1] Then
{
T1 = TotalTrades;
}
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 and C >= daylow+PriceScale*B1 Then
buy("b1");
if TotalTrades > TotalTrades[1] Then
LL = L;
if L < LL Then
LL = L;
if MarketPosition == 0 and
entry == 1 and
C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2 and
c<dayopen-2.5 and
IsExitName("StopInactivity",1) == true Then
buy("b2");
if MarketPosition== 1 Then
{
if IsEntryName("b1") == true Then
{
SetStopLoss(b1ls,PointStop);
SetStopTrailing(b1tr,0,PointStop,1);
SetStopInactivity(mi1,bg1,PointStop);
}
Else if IsEntryName("b2") == true Then
{
SetStopLoss(b2ls,PointStop);
SetStopTrailing(b2tr,0,PointStop,1);
SetStopInactivity(mi2,bg2,PointStop);
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
SetStopInactivity(0,0);
}
}
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 하루 2번 거래하는 수식입니다.
두번째 b2 진입에 필터를 두고 싶습니다.
필터 내용입니다.
1) b1 진입이 SetStopInactivity로 청산되면 b2 진입에 필터가 작동됩니다.
2) b2 진입은 ( c<dayopen-2.5 and b2 진입조건) 이 경우에만 허용됩니다.
항상 고맙습니다.
***************************************************************************************
input : b1(116);
input : b1ls(1.5),b1tr(2.7),mi1(0.5),bg1(150);
input : b2(122);
input : b2ls(2),b2tr(3.6),mi2(0),bg2(0);
var : T1(0),entry(0),LL(0),EH(0);
if Bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 and C >= daylow+PriceScale*B1 Then
buy("b1");
if TotalTrades > TotalTrades[1] Then
LL = L;
if L < LL Then
LL = L;
if MarketPosition == 0 and entry == 1 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2 Then
buy("b2");
if MarketPosition== 1 Then
{
if IsEntryName("b1") == true Then
{
SetStopLoss(b1ls,PointStop);
SetStopTrailing(b1tr,0,PointStop,1);
SetStopInactivity(mi1,bg1,PointStop);
}
Else if IsEntryName("b2") == true Then
{
SetStopLoss(b2ls,PointStop);
SetStopTrailing(b2tr,0,PointStop,1);
SetStopInactivity(mi2,bg2,PointStop);
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
SetStopInactivity(0,0);
}
}
2025-08-01
179
글번호 192928
시스템
답변완료
검색식 부탁 드려요
1 아래수식을 참조하여,
수식1)이 수식2)보다 위에 있는 모든종목 검색식 부탁드려요.(0봉전)
2. 캔들이(일봉) 수식1)을 양봉으로 돌파(몸통)하는 검색식
3. 캔들이(일봉) 수식2)를 양봉으로 돌파(몸통)하는 검색식 부탁드립니다
4. 캔들이 양봉으로 주봉 20이평선을 돌파(몸통)하는 검색식 부탁합니다
--------아래-----
(수식1)
tenkan=If(Sum(거래량, ConvPeriod) > 0,
Sum(((고가 + 저가) / 2) * 거래량, ConvPeriod) / Sum(거래량, ConvPeriod),
(Max(고가, ConvPeriod) + Min(저가, ConvPeriod)) / 2);
(수식2)
kijun = If(Sum(거래량, BasePeriod) > 0,
Sum(((고가 + 저가) / 2) * 거래량, BasePeriod) / Sum(거래량, BasePeriod),
(Max(고가, BasePeriod) + Min(저가, BasePeriod)) / 2);
(수식3)
shift(close,-25)
(수식4)
spanA = (tenkan + kijun) / 2;
//SHIFT(spanA,25)
(수식5)
spanB = tenkan=If(Sum(거래량, SpanBPeriod) > 0,
Sum(((고가 + 저가) / 2) * 거래량, SpanBPeriod) / Sum(거래량, SpanBPeriod),
(Max(고가, SpanBPeriod) + Min(저가, SpanBPeriod)) / 2);
//SHIFT(spanB,25)
- 지표조건설정
ConvPeriod : 9
BasePeriod : 26
SpanBPeriod : 52
Shift : 26
2025-08-01
189
글번호 192926
종목검색