예스스탁
예스스탁 답변
2020-04-10 10:59:05
안녕하세요
예스스탁입니다.
1-1 지표
input : MediaMovel(21),MediaMovelExponencial(9),MediaObv(50);
var : src(0),obv(0),mav(0),emav(0),obvma(0);
src = c;
mav = ma(src,MediaMovel);
emav = ema(src,MediaMovelExponencial);
obvma = ma(obv,MediaObv);
plot1(mav,"ma");
plot2(emav,"EMA");
1-2 시스템
input : MediaMovel(21),MediaMovelExponencial(9),MediaObv(50);
var : src(0),obv(0),mav(0),emav(0),obvma(0);
src = c;
mav = ma(src,MediaMovel);
emav = ema(src,MediaMovelExponencial);
obvma = ma(obv,MediaObv);
Condition1 = CrossUp(obv, obvma) and mav > emav;
Condition2 = CrossDown(obvma,obv);
if Condition1 == true Then
buy("COMPRA");
if Condition2 == true Then
sell("VENDA");
2
input : lagReduce(20.0),seriesLength(100),yes1(true);
var : seriesSource(0),exampleSeries(0),lagFilter(0);
seriesSource = c;
exampleSeries=ema(seriesSource, seriesLength);
lagFilter = exp(lagReduce*log(exampleSeries / exampleSeries[1]))*exampleSeries;
plot1(lagFilter,"lagFilter", MAGENTA);
plot2(iff(yes1,exampleSeries,nan),"exampleSeries",red);
즐거운 하루되세요
> 임진사댁원장 님이 쓴 글입니다.
> 제목 : 지표수식 전환부탁
> 예스지표로 수식전환 부탁드려요
<1>
src = input(close)
MediaMovel = input(21)
MediaMovelExponencial = input(9)
MediaObv = input(50)
obv = cum(change(close) > 0 ? volume : change(close) < 0 ? -volume : 0*volume)
ma = sma(src,MediaMovel)
ema = ema(src,MediaMovelExponencial)
obvma = sma(obv,MediaObv)
c = crossover(obv, obvma) and ma > ema
v = crossunder(obvma,obv)
plot(ma, color=#00FFFF, transp=0)
plot(ema,"EMA", color=#5e6adb, transp=0)
strategy.entry("COMPRA", strategy.long,when=c)
strategy.entry("VENDA", strategy.short,when=v)
//plot(obv/-10000000000000,title="OBV", color=blue)
//plot(ma,title="Média Móvel", color=blue)
//plotshape(c ? 1 : na, title="COMPRA",color=green, text="*COMPRA*", style=shape.arrowup, location=location.belowbar)
//plotshape(v ? 1 : na, title="VENDE",color=red, text="*VENDE*", style=shape.arrowdown)
<2>
//SETTINGS
lagReduce = input(20.0, title="Lag Reduction", minval=1, maxval=100)
seriesSource = input(close, title="Source", type=input.source)
seriesLength = input(100, title="Example Series Length for EMA")
yes1=input(true, title="Plot Original EMA as well?")
//FILTER
exampleSeries=ema(seriesSource, seriesLength)
lagFilter = exp(lagReduce*log(exampleSeries / exampleSeries[1]))*exampleSeries
//PLOTS
plot(lagFilter, color=color.lime)
plot(yes1? exampleSeries : na, color=color.red)