답변완료
수식 부탁드립니다
타주기 적용 부탁드립니다.
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
208
글번호 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
150
글번호 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
164
글번호 192926
종목검색
답변완료
검색식 부탁 드려요(재문의 드려요)
1. 아래수식을 참조하여(일봉기준),
주봉 20이평 (단순) 밑에서, 수식1) 이 수식2) 를 골든크로스
할때 종목검색식 부탁드려요.
누락부분 : (단, 0봉전~10봉전 모든종목)
확인 부탁드려요
--------아래-----
(수식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
---------------------
<보내주신 검색식>
input : ConvPeriod(9),BasePeriod(26),SpanBPeriod(52);
input : P(20);
var : tenkan(0),kijun(0);
var : cnt(0),sum(0),mav(0);
Array : CC[100](0);
tenkan=Iff(AccumN(v, ConvPeriod) > 0,
AccumN(((H + L) / 2) * v, ConvPeriod) / AccumN(v, ConvPeriod),
(highest(H, ConvPeriod) + Lowest(L, ConvPeriod)) / 2);
kijun = Iff(AccumN(V, BasePeriod) > 0,
AccumN(((H + L) / 2) * V, BasePeriod) / AccumN(V, BasePeriod),
(highest(H, BasePeriod) + Lowest(L, BasePeriod)) / 2);
if DayOfWeek(Bdate)< DayOfWeek(Bdate[1]) Then
{
for cnt = 99 downto 1
{
CC[cnt] = CC[cnt-1];
}
}
CC[0] = C;
if CC[P-1] > 0 Then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum+CC[cnt];
}
mav = sum/P;
if CrossUp(tenkan,kijun) Then
Find(1);
}
2025-08-01
166
글번호 192920
종목검색