답변완료
문의
아래의 지표식을 가지고 시스템을 만들고 싶습니다.
우선 지표식의 내용을 이해할수 있도록 각주좀 달아주시고요
FILTER 이 상승할때 매수 FILTER 이
FILTER 이 하락할때 매도인 식을 만들고 싶습니다.
input : f_type("Type1"),rng_qty(5),rng_scale("Average Change"),rng_per(20),smooth_range(true),smooth_per(30),mov_src("Close");
var : rng_size(0),hh(0),ll(0),bb(0),rr(0),rng_filt(0),h_band(0),l_band(0),filt(0);
var : upward(0),downward(0),filt_color(0),bar_color(0);
rng_size = iff(rng_scale=="Pips" , rng_qty*0.0001 ,
IFf(rng_scale=="Points" , rng_qty*pointvalue ,
iff(rng_scale=="% of Price", close*rng_qty/100 ,
iff(rng_scale=="ATR" , rng_qty*Ema(TrueRange, rng_per) ,
IFf(rng_scale=="Average Change" , IFf(IsNan(close[1]) == true, rng_qty*EMA(TrueRange, rng_per) , rng_qty*EMA(abs(close - close[1]), rng_per)) ,
IFf(rng_scale=="Standard Deviation" , STD(close, rng_per) ,
iff(rng_scale=="Ticks", rng_qty*PriceScale , rng_qty)))))));
if mov_src=="Wicks" Then
{
hh = h;
ll = l;
}
Else
{
hh = c;
ll = c;
}
bb = rng_size;
rr = iff(smooth_range, EMA(bb, smooth_per) , bb);
rng_filt = close;
if f_type=="Type1" Then
{
rng_filt = IFf(IsNan(rng_filt[1]) == true, close ,
IFf(hh > rng_filt[1] , IFf((hh - rr) < rng_filt[1] ,rng_filt[1], (hh - rr)) ,
IFf((ll + rr) > rng_filt[1] ,rng_filt[1] ,
(ll + rr))));
}
if f_type=="Type2" Then
{
rng_filt = IFF(IsNaN(rng_filt[1]) == true, close ,
IFf(h >= rng_filt[1] + rr , rng_filt[1] + floor(abs(hh - rng_filt[1])/rr)*rr ,
iff(ll <= rng_filt[1] - rr , rng_filt[1] - floor(abs(ll - rng_filt[1])/rr)*rr,
rng_filt[1])));
}
h_band = rng_filt + rr;
l_band = rng_filt - rr;
filt = rng_filt;
//Direction Conditions
upward = iff(filt > filt[1] , 1 , IFf(filt < filt[1] , 0 , upward));
downward = iff(filt < filt[1] , 1 , IFf(filt > filt[1] , 0 , downward));
//Colors
filt_color = iff(upward == 1, RED ,IFf(downward ==1,BLUE,GRAY));
bar_color = IFf( close > filt and close > close[1] and upward > 0 , RED ,
IFf( close > filt and close <= close[1] and upward > 0 , MAGENTA ,
IFf( close < filt and close < close[1] and downward > 0 , CYAN ,
IFf( close < filt and close >= close[1] and downward > 0 , BLUE , GREEN))));
plot1(filt, "Filter",filt_color);
plot2(h_band,"High Band",filt_color);
plot3(l_band,"Low Band",filt_color);
2023-07-18
1289
글번호 170733
시스템
답변완료
Re;수식 재문의 드림
안녕하세요
예스스탁입니다.
5% 상승시 청산하고자 하시면
목표이익 청산함수 이용하시면 됩니다.
1
Input : shortPeriod(5), longPeriod(20);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If CrossUP(value1, value2) Then
{
Buy();
}
SetStopProfittarget(5,PercentStop);
2
Input : shortPeriod(12), longPeriod(26);
Var : value(0);
value = MACD(shortPeriod, longPeriod);
If CrossUP(value, 0) Then
{
Buy();
}
SetStopProfittarget(5,PercentStop);
즐거운 하루되세요
> 금보 님이 쓴 글입니다.
> 제목 : 수식 문의
> 얀녕하세요
Input : shortPeriod(5), longPeriod(20);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If (CrossUP(value1, value2) + 0.5P ) Then
{
Sell();
}
1,,,위 매수식에서
0.5P 상승하면 매수청산
수식 부탁드립니다
2,,,
기타의 매수식에서
Input : shortPeriod(12), longPeriod(26);
Var : value(0);
value = MACD(shortPeriod, longPeriod);
# 매수/매도청산
If CrossUP(value, 0) Then
{
Buy();
}
# 매도/매수청산
If CrossUP(value, 0) + 0.5P Then
{
Sell();
}
감사합니다
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
안녕하세요
매도식에
매수신호와 매도신호가 동시에 나타납니다
피라미딩 허용시 신호가 무한대로 (((오류가))) 발생합니다
검증후 재 작성 부탁드립니다
Input : shortPeriod(5), longPeriod(20);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If SetStopProfittarget(1005,PercentStop) Then
{
Sell();
}
감사합니다
2023-07-18
1459
글번호 170728
시스템
답변완료
부탁드립니다.
수식 변형 부탁 드립니다.
indicator('[@btc_charlie] Trader XO Macro Trend Scanner', overlay=true)
// Variables
var ok = 0
var countBuy = 0
var countSell = 0
src = input(close, title='OHLC Type')
i_fastEMA = input(12, title='Fast EMA')
i_slowEMA = input(25, title='Slow EMA')
i_defEMA = input(25, title='Consolidated EMA')
// Allow the option to show single or double EMA
i_bothEMAs = input(title='Show Both EMAs', defval=true)
// Define EMAs
v_fastEMA = ta.ema(src, i_fastEMA)
v_slowEMA = ta.ema(src, i_slowEMA)
v_biasEMA = ta.ema(src, i_defEMA)
// Color the EMAs
emaColor = v_fastEMA > v_slowEMA ? color.green : v_fastEMA < v_slowEMA ? color.red : #FF530D
// Plot EMAs
plot(i_bothEMAs ? na : v_biasEMA, color=emaColor, linewidth=3, title='Consolidated EMA')
plot(i_bothEMAs ? v_fastEMA : na, title='Fast EMA', color=emaColor)
plot(i_bothEMAs ? v_slowEMA : na, title='Slow EMA', color=emaColor)
// Colour the bars
buy = v_fastEMA > v_slowEMA
sell = v_fastEMA < v_slowEMA
if buy
countBuy += 1
countBuy
if buy
countSell := 0
countSell
if sell
countSell += 1
countSell
if sell
countBuy := 0
countBuy
buysignal = countBuy < 2 and countBuy > 0 and countSell < 1 and buy and not buy[1]
sellsignal = countSell > 0 and countSell < 2 and countBuy < 1 and sell and not sell[1]
barcolor(buysignal ? color.green : na)
barcolor(sellsignal ? color.red : na)
// Plot Bull/Bear
plotshape(buysignal, title='Bull', text='Bull', style=shape.triangleup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.new(color.black, 0), size=size.tiny)
plotshape(sellsignal, title='Bear', text='Bear', style=shape.triangledown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.black, 0), size=size.tiny)
bull = countBuy > 1
bear = countSell > 1
barcolor(bull ? color.green : na)
barcolor(bear ? color.red : na)
2023-07-18
1178
글번호 170711
지표