예스스탁
예스스탁 답변
2021-10-05 11:48:38
안녕하세요
예스스탁입니다.
1. 지표
input : CMOlength(9),length3(30),momentumLength3(25);
var : P(0),S(0),up3(0),down3(0);
var : src(0),momm(0),m1(0),m2(0),sm1(0),sm2(0),chandeMO(0),rmi3(0);
src = c;
momm = src-src[1];
m1 =IFf(momm>= 0,momm,0);
m2 =IFf(momm>=0,0,-momm);
sm1 = AccumN(m1, CMOlength);
sm2 = AccumN(m2, CMOlength);
chandeMO = 100*(sm1-sm2)/(sm1+sm2);
P = 1/Length3;
S = src-src[momentumLength3];
up3 = iff(IsNaN(max(S,0)),ma(max(S,0),length3),P * max(S,0) + (1 - P) * up3);
down3 = iff(IsNaN(-min(S,0)),ma(-min(S,0),length3),P * -min(S,0) + (1 - P) * down3);
rmi3 = IFf(down3 == 0 , 100 , iff(up3 == 0 , 0 , 100 - (100 / (1 + up3 / down3))))-50;
input : lengthMA(7),lengthRSI(14);
var : R1(0),R2(0),thrsi(0),thrsi1(0);
R1 = rsi(lengthRSI);
thrsi = wma(wma(wma(R1, lengthMA), lengthMA), lengthMA);
thrsi1 = (thrsi-50)*10;
input : lengthMA2(7),lengthRSI2(14);
var : VolumeSum2(0),VWMA2(0),devwrsi(0);
R2 = rsi(lengthRSI2);
VolumeSum2 = AccumN( V, lengthMA2 ) ;
VWMA2 = AccumN( R2 * v , lengthMA2 ) / VolumeSum2 ;
devwrsi = ((ema(ema(vwma2, lengthMA2), lengthMA2))-50)*5;
input : lengthMA3(7),lengthRSI3(14);
var : R3(0),tersi(0),rmirsi(0);
R3 = rsi(lengthRSI3);
tersi = ((ema(ema(ema(R3, lengthMA3), lengthMA3), lengthMA3))-50)*10;
rmirsi = ((thrsi*rmi3/25));
//Boundary Lines
input : obLevel1(0),osLevel1(0);
PlotBaseLine1(obLevel1,"Chande Sellline");
PlotBaseLine2(osLevel1,"Chande Buyline");
input : obLevel2(0),osLevel2(0);
PlotBaseLine3(obLevel2,"Triple HMRSI Sellline");
PlotBaseLine4(osLevel2,"Triple HMRSI Buyline");
input : obLevel3(0),osLevel3(0);
PlotBaseLine5(obLevel3,"DEVWRSI Sellline");
PlotBaseLine6(osLevel3,"DEVWRSI Buyline");
input : obLevel4(0),osLevel4(0);
PlotBaseLine7(obLevel4,"TERSI Sellline");
PlotBaseLine8(osLevel4,"TERSI Buyline");
input : obLevel5(0),osLevel5(0);
PlotBaseLine9(obLevel5,"RMI Sellline");
PlotBaseLine10(osLevel5,"RMI Buyline");
input : obLevel6(0),osLevel6(0);
PlotBaseLine11(obLevel6,"RMI*RSI Sellline");
PlotBaseLine12(osLevel6,"RMI*RSI Buyline");
plot1((thrsi1),"THRSI");
plot2(devwrsi,"DEVWRSI",RED);
plot3(tersi,"TERSI",yellow);
plot4(rmirsi,"RMI*HMRSI",MAGENTA);
plot5(rmi3,"RMI",CYAN);
PlotBaseLine13(0);
2. 시스템
input : CMOlength(9),length3(30),momentumLength3(25);
var : P(0),S(0),up3(0),down3(0);
var : src(0),momm(0),m1(0),m2(0),sm1(0),sm2(0),chandeMO(0),rmi3(0);
src = c;
momm = src-src[1];
m1 =IFf(momm>= 0,momm,0);
m2 =IFf(momm>=0,0,-momm);
sm1 = AccumN(m1, CMOlength);
sm2 = AccumN(m2, CMOlength);
chandeMO = 100*(sm1-sm2)/(sm1+sm2);
P = 1/Length3;
S = src-src[momentumLength3];
up3 = iff(IsNaN(max(S,0)),ma(max(S,0),length3),P * max(S,0) + (1 - P) * up3);
down3 = iff(IsNaN(-min(S,0)),ma(-min(S,0),length3),P * -min(S,0) + (1 - P) * down3);
rmi3 = IFf(down3 == 0 , 100 , iff(up3 == 0 , 0 , 100 - (100 / (1 + up3 / down3))))-50;
input : lengthMA(7),lengthRSI(14);
var : R1(0),R2(0),thrsi(0),thrsi1(0);
R1 = rsi(lengthRSI);
thrsi = wma(wma(wma(R1, lengthMA), lengthMA), lengthMA);
thrsi1 = (thrsi-50)*10;
input : lengthMA2(7),lengthRSI2(14);
var : VolumeSum2(0),VWMA2(0),devwrsi(0);
R2 = rsi(lengthRSI2);
VolumeSum2 = AccumN( V, lengthMA2 ) ;
VWMA2 = AccumN( R2 * v , lengthMA2 ) / VolumeSum2 ;
devwrsi = ((ema(ema(vwma2, lengthMA2), lengthMA2))-50)*5;
input : lengthMA3(7),lengthRSI3(14);
var : R3(0),tersi(0),rmirsi(0);
R3 = rsi(lengthRSI3);
tersi = ((ema(ema(ema(R3, lengthMA3), lengthMA3), lengthMA3))-50)*10;
rmirsi = ((thrsi*rmi3/25));
//Boundary Lines
input : obLevel1(0),osLevel1(0);
input : obLevel2(0),osLevel2(0);
input : obLevel3(0),osLevel3(0);
input : obLevel4(0),osLevel4(0);
input : obLevel5(0),osLevel5(0);
input : obLevel6(0),osLevel6(0);
VAR : longcondition1(False),shortcondition1(False),longcondition2(False),shortcondition2(False);
longcondition1 = CrossUp(chandeMO, osLevel1);
shortcondition1 = CrossDown(chandeMO, obLevel1);
longcondition2 = rmirsi<osLevel6 and rmi3<osLevel5 and tersi<osLevel4 and devwrsi<osLevel3 and thrsi1<osLevel2 and longcondition1;
shortcondition2 = rmirsi>obLevel6 and rmi3>obLevel5 and tersi>obLevel4 and devwrsi>obLevel3 and thrsi1>obLevel2 and shortcondition1;
if longcondition2 Then
Buy("Buy");
if shortcondition2 Then
sell("sell");
즐거운 하루되세요
> 코샘매쓰 님이 쓴 글입니다.
> 제목 : 변환부탁드립니다.
>
src = input(close, "Price", type = input.source)
CMOlength = input(9, minval=1, title="Alpha Chande Momentum Length")
//CMO
momm = change(src)
f1(m) => m >= 0.0 ? m : 0.0
f2(m) => m >= 0.0 ? 0.0 : -m
m1 = f1(momm)
m2 = f2(momm)
sm1 = sum(m1, CMOlength)
sm2 = sum(m2, CMOlength)
percent(nom, div) => 100 * nom / div
chandeMO = percent(sm1-sm2, sm1+sm2)
plot(chandeMO, "Chande MO", color=color.blue)
//RMI
length3 = input(title="RMI Length", type=input.integer, minval=1, defval=30)
momentumLength3 = input(title="RMI Momentum ", type=input.integer, minval=1, defval=25)
up3 = rma(max(change(src, momentumLength3), 0), length3)
down3 = rma(-min(change(src, momentumLength3), 0), length3)
rmi3 = (down3 == 0 ? 100 : up3 == 0 ? 0 : 100 - (100 / (1 + up3 / down3)))-50
//
//
lengthMA = input(7)
lengthRSI = input(14)
thrsi = hma(hma(hma(rsi(src, lengthRSI), lengthMA), lengthMA), lengthMA)
thrsi1 = (thrsi-50)*10
lengthMA2 = input(7)
lengthRSI2 = input(14)
devwrsi = ((ema(ema(vwma(rsi(src, lengthRSI2), lengthMA2), lengthMA2), lengthMA2))-50)*5
lengthMA3 = input(7)
lengthRSI3 = input(14)
tersi = ((ema(ema(ema(rsi(src, lengthRSI3), lengthMA3), lengthMA3), lengthMA3))-50)*10
rmirsi = ((thrsi*rmi3/25))
//Boundary Lines
obLevel1 = input(0, title="Chande Sellline")
osLevel1 = input(0, title="Chande Buyline")
hline(obLevel1, color=#0bc4d9)
hline(osLevel1, color=#0bc4d9)
obLevel2 = input(0, title="Triple HMRSI Sellline")
osLevel2 = input(0, title="Triple HMRSI Buyline")
hline(obLevel2, color=#5a0bd9)
hline(osLevel2, color=#5a0bd9)
obLevel3 = input(0, title="DEVWRSI Sellline")
osLevel3 = input(0, title="DEVWRSI Buyline")
hline(obLevel3, color=#5a0bd9)
hline(osLevel3, color=#5a0bd9)
obLevel4 = input(0, title="TERSI Sellline")
osLevel4 = input(0, title="TERSI Buyline")
hline(obLevel4, color=#5a0bd9)
hline(osLevel4, color=#5a0bd9)
obLevel5 = input(0, title="RMI Sellline")
osLevel5 = input(0, title="RMI Buyline")
hline(obLevel5, color=#5a0bd9)
hline(osLevel5, color=#5a0bd9)
obLevel6 = input(0, title="RMI*RSI Sellline")
osLevel6 = input(0, title="RMI*RSI Buyline")
hline(obLevel6, color=#5a0bd9)
hline(osLevel6, color=#5a0bd9)
plot((thrsi1), title="THRSI")
plot(devwrsi, color=color.red, title="DEVWRSI")
plot(tersi, color=color.yellow, title="TERSI")
plot(rmirsi, color=color.purple, title="RMI*HMRSI")
plot(rmi3, color=color.orange, title="RMI")
longcondition1 = crossover(chandeMO, osLevel1)
shortcondition1 = crossunder(chandeMO, obLevel1)
longcondition2 = rmirsi<osLevel6 and rmi3<osLevel5 and tersi<osLevel4 and devwrsi<osLevel3 and thrsi1<osLevel2 and longcondition1
shortcondition2 = rmirsi>obLevel6 and rmi3>obLevel5 and tersi>obLevel4 and devwrsi>obLevel3 and thrsi1>obLevel2 and shortcondition1
if testPeriod()
if longcondition2
strategy.entry("Buy", strategy.long)
if shortcondition2
strategy.entry("Sell", strategy.short)
hline(0, color=#C0C0C0, linestyle=hline.style_dashed, title="Zero Line")