커뮤니티
시스템 수식 부탁드립니다.
2015-12-23 15:14:12
134
글번호 93741
안녕하세요.
시스템 수식 작성 부탁드립니다.
매수 : 적합이동평균선 5이평 > 20 이평
MACD 시그널 > 0선
CCI 시그널 > 0선
이러한 조건이 모두 충족되었을 경우에만 매수.
매수청산 : MACD < MACD 시그널
MACD가 시그널을 하향돌파할때 매수청산.
매도 : 적합이동평균선 5이평 < 20 이평
MACD 시그널 < 0선
CCI 시그널 < 0선
이러한 조건이 모두 충족되었을 경우에만 매도.
매도청산 : MACD > MACD 시그널
MACD가 시그널을 상향돌파할때 매도청산.
부탁드리겠습니다.
답변 1
예스스탁 예스스탁 답변
2015-12-23 15:50:04
안녕하세요
예스스탁입니다.
Inputs: Period1(5),Period2(20);
Input : short(12),long(26),sig(9);
Input : CCIP(9),CCIPsig(10);
Var : Diff(0), Fastest(0.6667), Slowest(0.0645);
var : Noise1(0), Signal1(0), efRatio1(0), Smooth1(1), AdaptMA1(0);
var : Noise2(0), Signal2(0), efRatio2(0), Smooth2(1), AdaptMA2(0);
Var : MACDv(0),MACDS(0);
var : CCIv(0),CCIsig(0);
Diff = Abs(C - C[1]);
IF CurrentBar <= Period1 Then
AdaptMA1 = Close;
IF CurrentBar > Period1 Then Begin
Signal1 = Abs(C - C[Period1]);
Noise1 = accumN(Diff, Period1);
efRatio1 = Signal1/ Noise1;
Smooth1 = Power(efRatio1 * (Fastest - Slowest) + Slowest, 2);
AdaptMA1 = AdaptMA1[1] + Smooth1 * (Close - AdaptMA1[1]);
End;
IF CurrentBar <= Period2 Then
AdaptMA2 = Close;
IF CurrentBar > Period2 Then Begin
Signal2 = Abs(C - C[Period2]);
Noise2 = accumN(Diff, Period2);
efRatio2 = Signal2/ Noise2;
Smooth2 = Power(efRatio2 * (Fastest - Slowest) + Slowest, 2);
AdaptMA2 = AdaptMA2[1] + Smooth2 * (Close - AdaptMA2[1]);
End;
MACDv = MACD(short, long);
MACDs = ema(MACDv,sig);
CCIv = CCI(CCIP);
CCIsig = ema(CCIv,CCIPsig);
Condition1 = AdaptMA1 > AdaptMA2 and MACDs > 0 and CCIsig > 0;
Condition2 = AdaptMA1 < AdaptMA2 and MACDs < 0 and CCIsig < 0;
if Condition1 == true and Condition1[1] == false Then
buy("매수");
if MarketPosition == 1 and CrossDown(MACDV,MACDS) Then
exitlong("매수청산");
if Condition2 == true and Condition2[1] == false Then
sell("매도");
if MarketPosition == -1 and CrossUp(MACDV,MACDS) Then
ExitShort("매도청산");
즐거운 하루되세요
> 민규아빠 님이 쓴 글입니다.
> 제목 : 시스템 수식 부탁드립니다.
> 안녕하세요.
시스템 수식 작성 부탁드립니다.
매수 : 적합이동평균선 5이평 > 20 이평
MACD 시그널 > 0선
CCI 시그널 > 0선
이러한 조건이 모두 충족되었을 경우에만 매수.
매수청산 : MACD < MACD 시그널
MACD가 시그널을 하향돌파할때 매수청산.
매도 : 적합이동평균선 5이평 < 20 이평
MACD 시그널 < 0선
CCI 시그널 < 0선
이러한 조건이 모두 충족되었을 경우에만 매도.
매도청산 : MACD > MACD 시그널
MACD가 시그널을 상향돌파할때 매도청산.
부탁드리겠습니다.