커뮤니티
수식작성 부탁드립니다.
2011-05-31 13:17:00
624
글번호 39256
정말 감사드립니다.
일전에 비슷한 것을 문의드렸는데요.
아래 로직은 kodex200을 참조종목(일봉) 으로 하는 포지션 트레이딩 로직입니다.
일전에 부탁드렸듯이 매수청산시에는 매수를 , 원로직 매수시 매수청산을 할수록
반대로 시스템식 작성 부탁드립니다.
다음은 원로직 입니다.
// KODEX200 참조 KODEX200 적용 
Input : EmaLen(13), macd1(12), macd2(26), macd3(9), stoploss(5), len(5), mult(8), DiV(25);
input: LongEmaLen(65), Longmacd1(60), Longmacd2(130), Longmacd3(45);
var :  emaV(0), MacdV(0), MacdS(0), MacdOsc(0);
var :  mp(0), stopprice(0), LemaV(0), LmacdV(0), LmacdS(0), LmacdOsc(0);
 
emaV = data2(ema(C,EmaLen));
MacdV = data2(macd(macd1,macd2));
MacdS = data2(ema(MacdV,macd3));
MacdOsc = MacdV-MacdS;
LemaV = data2(ema(C,LongEmaLen));
LmacdV = data2(macd(Longmacd1,Longmacd2));
LmacdS = data2(ema(LmacdV,Longmacd3));
LmacdOsc = LmacdV-LmacdS;
If LemaV > LemaV[1] and LmacdOsc > LmacdOsc[1] then {
    if emaV > emaV[1] and macdOsc > MacdOsc[1] Then
     buy();
} 
mp = marketposition;
#mp에 marketposition
if MP == 1 and MP[1] <> 1 then Begin
 StopPrice = low - ma(range,4)*mult;
end;
If MP == 1 then begin
 exitlong ("ExitLong", atstop,stopprice );
 stopprice = stopprice +( low-stopprice )/Div;
end;
input : af(0.0045), maxaf(0.1);
var : parabolic(0);
parabolic = sar(af, maxaf);
if MarketPosition <> 0 then {
    if c > parabolic Then
    exitlong("EL_파라볼릭청산", ATSTOP, PARABOLIC);
}
답변 1
예스스탁 예스스탁 답변
2011-05-31 16:30:05
안녕하세요
예스스탁입니다.
// KODEX200 참조 KODEX200 적용
Input : EmaLen(13), macd1(12), macd2(26), macd3(9), stoploss(5), len(5), mult(8), DiV(25);
input: LongEmaLen(65), Longmacd1(60), Longmacd2(130), Longmacd3(45);
var : emaV(0), MacdV(0), MacdS(0), MacdOsc(0);
var : mp(0), stopprice(0), LemaV(0), LmacdV(0), LmacdS(0), LmacdOsc(0),cond(false),Vr1(0);
emaV = data2(ema(C,EmaLen));
MacdV = data2(macd(macd1,macd2));
MacdS = data2(ema(MacdV,macd3));
MacdOsc = MacdV-MacdS;
LemaV = data2(ema(C,LongEmaLen));
LmacdV = data2(macd(Longmacd1,Longmacd2));
LmacdS = data2(ema(LmacdV,Longmacd3));
LmacdOsc = LmacdV-LmacdS;
cond = LemaV > LemaV[1] and LmacdOsc > LmacdOsc[1] and emaV > emaV[1] and macdOsc > MacdOsc[1];
If vr1 == 0 and cond == true Then{
vr1 = 1;
}
#mp = marketposition;
#mp에 marketposition
if vr1 == 1 and vr1[1] == 0 then{
StopPrice = low - ma(range,4)*mult;
}
If vr1 == 1 then begin
if L <= Stopprice then
vr1 = 0;
stopprice = stopprice +( low-stopprice )/Div;
end;
input : af(0.0045), maxaf(0.1);
var : parabolic(0);
parabolic = sar(af, maxaf);
if vr1 == 1 then {
if c[1] > parabolic[1] and L <= PARABOLIC[1] Then
vr1 = 0;
#exitlong("EL_파라볼릭청산", ATSTOP, PARABOLIC);
}
if vr1 == 0 and vr1[1] == 1 then
buy();
if vr1 == 1 and vr1[1] == 0 then
ExitLong();
즐거운 하루되세요
> 도시군인 님이 쓴 글입니다.
> 제목 : 수식작성 부탁드립니다.
> 정말 감사드립니다.
일전에 비슷한 것을 문의드렸는데요.
아래 로직은 kodex200을 참조종목(일봉) 으로 하는 포지션 트레이딩 로직입니다.
일전에 부탁드렸듯이 매수청산시에는 매수를 , 원로직 매수시 매수청산을 할수록
반대로 시스템식 작성 부탁드립니다.
다음은 원로직 입니다.
// KODEX200 참조 KODEX200 적용
Input : EmaLen(13), macd1(12), macd2(26), macd3(9), stoploss(5), len(5), mult(8), DiV(25);
input: LongEmaLen(65), Longmacd1(60), Longmacd2(130), Longmacd3(45);
var : emaV(0), MacdV(0), MacdS(0), MacdOsc(0);
var : mp(0), stopprice(0), LemaV(0), LmacdV(0), LmacdS(0), LmacdOsc(0);
emaV = data2(ema(C,EmaLen));
MacdV = data2(macd(macd1,macd2));
MacdS = data2(ema(MacdV,macd3));
MacdOsc = MacdV-MacdS;
LemaV = data2(ema(C,LongEmaLen));
LmacdV = data2(macd(Longmacd1,Longmacd2));
LmacdS = data2(ema(LmacdV,Longmacd3));
LmacdOsc = LmacdV-LmacdS;
If LemaV > LemaV[1] and LmacdOsc > LmacdOsc[1] then {
if emaV > emaV[1] and macdOsc > MacdOsc[1] Then
buy();
}
mp = marketposition;
#mp에 marketposition
if MP == 1 and MP[1] <> 1 then Begin
StopPrice = low - ma(range,4)*mult;
end;
If MP == 1 then begin
exitlong ("ExitLong", atstop,stopprice );
stopprice = stopprice +( low-stopprice )/Div;
end;
input : af(0.0045), maxaf(0.1);
var : parabolic(0);
parabolic = sar(af, maxaf);
if MarketPosition <> 0 then {
if c > parabolic Then
exitlong("EL_파라볼릭청산", ATSTOP, PARABOLIC);
}
다음글
이전글