커뮤니티
문의 드립니다.
2016-12-16 12:30:35
109
글번호 105028
input : P1(20),P2(40),P3(80),횡보폭(0.05),X(5);
var : ema1(0),ema2(0),횡보(false);
Var: Noise(0), Signal(0), Diff(0), efRatio(0), Smooth(1), Fastest(0.6667), Slowest(0.0645), AdaptMA(0);
ema1 = ema(C,P1);
ema2 = ema(C,P2);
Diff = AbsValue(Close - Close[1]);
IF index <= P3 Then
AdaptMA = Close;
IF index > P3 Then Begin
Signal = AbsValue(Close - Close[P3]);
Noise = accumN(Diff, P3);
efRatio = Signal / Noise;
Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2);
AdaptMA = AdaptMA[1] + Smooth * (Close - AdaptMA[1]);
End;
if max(ema1,ema2,AdaptMA) <= min(ema1,ema2,AdaptMA)+횡보폭 Then
횡보 = true;
Else
횡보 = false;
#X봉 이상 횡보하다가 횡보가 해제
if 횡보 == false and 횡보[1] == true and countif(횡보 == true,X)[1] == X Then{
if MarketPosition <= 0 and C > ema1 Then
buy();
if MarketPosition >= 0 and C < ema1 Then
sell();
}
if MarketPosition == 1 and C < AdaptMA and C < O Then
exitlong();
if MarketPosition == -1 and C > AdaptMA and C > O Then
ExitShort();
안녕하십니까?
위 수식이 크루드 오일외 타 종목에서는 적용이 안되는 이유를 알고싶습니다. 이유가 있다면 모든 종목에 적용이 가능하도록 수정 부탁드립니다. 감사합니다.
답변 1
예스스탁 예스스탁 답변
2016-12-16 14:38:14
안녕하세요
예스스탁입니다.
외부변수에 횡보폭이라는 외부변수가 있습니다.
해당 값이 포인트로 수식에 지정이 되어 있습니다.
종목에 맞게 가격을 지정하셔야 합니다.
설정하시기 편하게 포인트가 아닌
틱수로 지정할수 있게 변경해 드립니다.
input : P1(20),P2(40),P3(80),횡보폭틱수(10),X(5);
var : ema1(0),ema2(0),횡보(false);
Var: Noise(0), Signal(0), Diff(0), efRatio(0), Smooth(1), Fastest(0.6667), Slowest(0.0645), AdaptMA(0);
ema1 = ema(C,P1);
ema2 = ema(C,P2);
Diff = AbsValue(Close - Close[1]);
IF index <= P3 Then
AdaptMA = Close;
IF index > P3 Then Begin
Signal = AbsValue(Close - Close[P3]);
Noise = accumN(Diff, P3);
efRatio = Signal / Noise;
Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2);
AdaptMA = AdaptMA[1] + Smooth * (Close - AdaptMA[1]);
End;
if max(ema1,ema2,AdaptMA) <= min(ema1,ema2,AdaptMA)+(PriceScale*횡보폭틱수) Then
횡보 = true;
Else
횡보 = false;
#X봉 이상 횡보하다가 횡보가 해제
if 횡보 == false and 횡보[1] == true and countif(횡보 == true,X)[1] == X Then{
if MarketPosition <= 0 and C > ema1 Then
buy();
if MarketPosition >= 0 and C < ema1 Then
sell();
}
if MarketPosition == 1 and C < AdaptMA and C < O Then
exitlong();
if MarketPosition == -1 and C > AdaptMA and C > O Then
ExitShort();
즐거운 하루되세요
> dhfmfl 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> input : P1(20),P2(40),P3(80),횡보폭(0.05),X(5);
var : ema1(0),ema2(0),횡보(false);
Var: Noise(0), Signal(0), Diff(0), efRatio(0), Smooth(1), Fastest(0.6667), Slowest(0.0645), AdaptMA(0);
ema1 = ema(C,P1);
ema2 = ema(C,P2);
Diff = AbsValue(Close - Close[1]);
IF index <= P3 Then
AdaptMA = Close;
IF index > P3 Then Begin
Signal = AbsValue(Close - Close[P3]);
Noise = accumN(Diff, P3);
efRatio = Signal / Noise;
Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2);
AdaptMA = AdaptMA[1] + Smooth * (Close - AdaptMA[1]);
End;
if max(ema1,ema2,AdaptMA) <= min(ema1,ema2,AdaptMA)+횡보폭 Then
횡보 = true;
Else
횡보 = false;
#X봉 이상 횡보하다가 횡보가 해제
if 횡보 == false and 횡보[1] == true and countif(횡보 == true,X)[1] == X Then{
if MarketPosition <= 0 and C > ema1 Then
buy();
if MarketPosition >= 0 and C < ema1 Then
sell();
}
if MarketPosition == 1 and C < AdaptMA and C < O Then
exitlong();
if MarketPosition == -1 and C > AdaptMA and C > O Then
ExitShort();
안녕하십니까?
위 수식이 크루드 오일외 타 종목에서는 적용이 안되는 이유를 알고싶습니다. 이유가 있다면 모든 종목에 적용이 가능하도록 수정 부탁드립니다. 감사합니다.