커뮤니티

문의 드립니다.

프로필 이미지
소주까기인형
2012-10-10 22:23:21
448
글번호 55513
답변완료

첨부 이미지

안녕하세요 가르쳐 주신 수식을 이용해서 공부를 하고있습니다. 그런데 이해할수없는 현상이 생겨서 그림파일첨부해서 여쭤봅니다. 사용한 수식------------------------------ input : P1(5),P2(20),ShortPeriod(12),LongPeriod(26), Period(9),N1(0),N2(0),loss(-1),entry(5); var : PredayPL(0),XCommission(0),XSlippage(0),dayPL(0),count(0),cnt(0); #당일누적손익계산 시작 if date != date[1] Then PredayPL = NetProfit[1]; XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정 XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정 if MarketPosition() == 0 Then dayPL = (NetProfit-PredayPL); Else dayPL = (NetProfit-PredayPL)+(PositionProfit-(XCommission+XSlippage)); count = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then count=count+1; } var1 = ma(c,P1); var2 = ma(C,P2); var3 = MACD(ShortPeriod,LongPeriod); var4 = ema(var3, Period); Condition1 = crossup(var1,var2) and var3 >= var4; Condition2 = CrossUP(var3,var4) and var1 >= var2; Condition3 = var1-var2 >= N1; Condition4 = CrossDown(var1,var2) and var3 < var4; Condition5 = Crossdown(var3,var4) and var1 < var2; Condition6 = var1-var2 <= N2; Condition7 = dayPL > Loss; Condition8 = count < entry; if stime == 151500 and MarketPosition == 0 Then{ if MarketPosition(1) == 1 Then buy("b",AtMarket); if MarketPosition(1) == -1 Then sell("s",AtMarket); } if (Condition1 or Condition2) and Condition3 and Condition7 and Condition8 Then buy(); if Condition4 or Condition5 Then ExitLong(); if (Condition4 or Condition5) and Condition6 and Condition7 and Condition8 Then sell(); if Condition1 or Condition2 Then ExitShort();
시스템
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2012-10-12 13:17:05

안녕하세요 예스스탁입니다. 동그라미 친부분의 신호는 매수진입신호가 아닙니다. 매도포지션을 청산하는 exitshort신호입니다. 27일 첫봉에 매도로 진입하고 10시에서 11시 사이에 매도포지션을 청산한것입니다. 28일 첫신호는 어제 마지막 거래가 매도포지션이므로 발생한것입니다. 수식을 수정했습니다. 아래식 이용하시면 됩니다. input : P1(5),P2(20),ShortPeriod(12),LongPeriod(26), Period(9),N1(0),N2(0),loss(-1),entry(5); var : PredayPL(0),XCommission(0),XSlippage(0),dayPL(0),count(0),cnt(0); count = 0; dayPL = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then{ count=count+1; dayPL = daypl+PositionProfit(cnt); } } var1 = ma(c,P1); var2 = ma(C,P2); var3 = MACD(ShortPeriod,LongPeriod); var4 = ema(var3, Period); Condition1 = crossup(var1,var2) and var3 >= var4; Condition2 = CrossUP(var3,var4) and var1 >= var2; Condition3 = var1-var2 >= N1; Condition4 = CrossDown(var1,var2) and var3 < var4; Condition5 = Crossdown(var3,var4) and var1 < var2; Condition6 = var1-var2 <= N2; Condition7 = dayPL > Loss; Condition8 = count < entry; if stime == 151500 and MarketPosition == 0 Then{ if MarketPosition(1) == 1 Then buy("b",AtMarket); if MarketPosition(1) == -1 Then sell("s",AtMarket); } if (Condition1 or Condition2) and Condition3 and Condition7 and Condition8 Then buy("매수진입"); if Condition4 or Condition5 Then ExitLong("매수포지션청산"); if (Condition4 or Condition5) and Condition6 and Condition7 and Condition8 Then sell("매도진입"); if Condition1 or Condition2 Then ExitShort("매도포지션청산"); 즐거운 하루되세요 > 소주까기인형 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 안녕하세요 가르쳐 주신 수식을 이용해서 공부를 하고있습니다. 그런데 이해할수없는 현상이 생겨서 그림파일첨부해서 여쭤봅니다. 사용한 수식------------------------------ input : P1(5),P2(20),ShortPeriod(12),LongPeriod(26), Period(9),N1(0),N2(0),loss(-1),entry(5); var : PredayPL(0),XCommission(0),XSlippage(0),dayPL(0),count(0),cnt(0); #당일누적손익계산 시작 if date != date[1] Then PredayPL = NetProfit[1]; XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정 XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정 if MarketPosition() == 0 Then dayPL = (NetProfit-PredayPL); Else dayPL = (NetProfit-PredayPL)+(PositionProfit-(XCommission+XSlippage)); count = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then count=count+1; } var1 = ma(c,P1); var2 = ma(C,P2); var3 = MACD(ShortPeriod,LongPeriod); var4 = ema(var3, Period); Condition1 = crossup(var1,var2) and var3 >= var4; Condition2 = CrossUP(var3,var4) and var1 >= var2; Condition3 = var1-var2 >= N1; Condition4 = CrossDown(var1,var2) and var3 < var4; Condition5 = Crossdown(var3,var4) and var1 < var2; Condition6 = var1-var2 <= N2; Condition7 = dayPL > Loss; Condition8 = count < entry; if stime == 151500 and MarketPosition == 0 Then{ if MarketPosition(1) == 1 Then buy("b",AtMarket); if MarketPosition(1) == -1 Then sell("s",AtMarket); } if (Condition1 or Condition2) and Condition3 and Condition7 and Condition8 Then buy(); if Condition4 or Condition5 Then ExitLong(); if (Condition4 or Condition5) and Condition6 and Condition7 and Condition8 Then sell(); if Condition1 or Condition2 Then ExitShort();
프로필 이미지

예스스탁 예스스탁 답변

2012-10-12 13:16:21

안녕하세요 예스스탁입니다. input : P1(5),P2(20),ShortPeriod(12),LongPeriod(26), Period(9),N1(0),N2(0),loss(-1),entry(5); var : PredayPL(0),XCommission(0),XSlippage(0),dayPL(0),count(0),cnt(0); count = 0; dayPL = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then{ count=count+1; dayPL = daypl+PositionProfit(cnt); } } var1 = ma(c,P1); var2 = ma(C,P2); var3 = MACD(ShortPeriod,LongPeriod); var4 = ema(var3, Period); Condition1 = var1 > var2 and var3 >= var4; Condition2 = var3 > var4 and var1 >= var2; Condition3 = var1-var2 >= N1; Condition4 = var1 < var2 and var3 < var4; Condition5 = var3 < var4 and var1 < var2; Condition6 = var1-var2 <= N2; Condition7 = dayPL > Loss; Condition8 = count < entry; if stime == 151500 and MarketPosition == 0 Then{ if MarketPosition(1) == 1 Then buy("b",AtMarket); if MarketPosition(1) == -1 Then sell("s",AtMarket); } if (Condition1 or Condition2) and Condition3 and Condition7 and Condition8 Then buy("매수진입"); if Condition4 or Condition5 Then ExitLong("매수포지션청산"); if (Condition4 or Condition5) and Condition6 and Condition7 and Condition8 Then sell("매도진입"); if Condition1 or Condition2 Then ExitShort("매도포지션청산"); 즐거운 하루되세여 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 동그라미 친부분의 신호는 매수진입신호가 아닙니다. 매도포지션을 청산하는 exitshort신호입니다. 27일 첫봉에 매도로 진입하고 10시에서 11시 사이에 매도포지션을 청산한것입니다. 28일 첫신호는 어제 마지막 거래가 매도포지션이므로 발생한것입니다. 수식을 수정했습니다. 아래식 이용하시면 됩니다. input : P1(5),P2(20),ShortPeriod(12),LongPeriod(26), Period(9),N1(0),N2(0),loss(-1),entry(5); var : PredayPL(0),XCommission(0),XSlippage(0),dayPL(0),count(0),cnt(0); count = 0; dayPL = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then{ count=count+1; dayPL = daypl+PositionProfit(cnt); } } var1 = ma(c,P1); var2 = ma(C,P2); var3 = MACD(ShortPeriod,LongPeriod); var4 = ema(var3, Period); Condition1 = crossup(var1,var2) and var3 >= var4; Condition2 = CrossUP(var3,var4) and var1 >= var2; Condition3 = var1-var2 >= N1; Condition4 = CrossDown(var1,var2) and var3 < var4; Condition5 = Crossdown(var3,var4) and var1 < var2; Condition6 = var1-var2 <= N2; Condition7 = dayPL > Loss; Condition8 = count < entry; if stime == 151500 and MarketPosition == 0 Then{ if MarketPosition(1) == 1 Then buy("b",AtMarket); if MarketPosition(1) == -1 Then sell("s",AtMarket); } if (Condition1 or Condition2) and Condition3 and Condition7 and Condition8 Then buy("매수진입"); if Condition4 or Condition5 Then ExitLong("매수포지션청산"); if (Condition4 or Condition5) and Condition6 and Condition7 and Condition8 Then sell("매도진입"); if Condition1 or Condition2 Then ExitShort("매도포지션청산"); 즐거운 하루되세요 > 소주까기인형 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 안녕하세요 가르쳐 주신 수식을 이용해서 공부를 하고있습니다. 그런데 이해할수없는 현상이 생겨서 그림파일첨부해서 여쭤봅니다. 사용한 수식------------------------------ input : P1(5),P2(20),ShortPeriod(12),LongPeriod(26), Period(9),N1(0),N2(0),loss(-1),entry(5); var : PredayPL(0),XCommission(0),XSlippage(0),dayPL(0),count(0),cnt(0); #당일누적손익계산 시작 if date != date[1] Then PredayPL = NetProfit[1]; XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정 XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정 if MarketPosition() == 0 Then dayPL = (NetProfit-PredayPL); Else dayPL = (NetProfit-PredayPL)+(PositionProfit-(XCommission+XSlippage)); count = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then count=count+1; } var1 = ma(c,P1); var2 = ma(C,P2); var3 = MACD(ShortPeriod,LongPeriod); var4 = ema(var3, Period); Condition1 = crossup(var1,var2) and var3 >= var4; Condition2 = CrossUP(var3,var4) and var1 >= var2; Condition3 = var1-var2 >= N1; Condition4 = CrossDown(var1,var2) and var3 < var4; Condition5 = Crossdown(var3,var4) and var1 < var2; Condition6 = var1-var2 <= N2; Condition7 = dayPL > Loss; Condition8 = count < entry; if stime == 151500 and MarketPosition == 0 Then{ if MarketPosition(1) == 1 Then buy("b",AtMarket); if MarketPosition(1) == -1 Then sell("s",AtMarket); } if (Condition1 or Condition2) and Condition3 and Condition7 and Condition8 Then buy(); if Condition4 or Condition5 Then ExitLong(); if (Condition4 or Condition5) and Condition6 and Condition7 and Condition8 Then sell(); if Condition1 or Condition2 Then ExitShort();
프로필 이미지

예스스탁 예스스탁 답변

2012-10-12 13:25:31

식을 좀 단순히 줄여보았습니다. 혹시 몰라 변수도 이름을 따로 지어 작성했습니다. input : P1(5),P2(20),loss(-3),entry(4); var : PredayPL(0),dayPL(0),count(0),cnt(0); var : mav1(0),mav2(0),losscond(false),entrycond(false); count = 0; dayPL = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then{ count=count+1; dayPL = daypl+PositionProfit(cnt);} } mav1 = ma(c,P1); mav2 = ma(C,P2); losscond = dayPL > Loss; entrycond = count < entry; if mav1 > mav2 and losscond and entrycond Then Buy("매수진입"); if mav1 < mav2 Then ExitLong("매수포지션청산"); if mav1 < mav2 and losscond and entrycond Then Sell("매도진입"); if mav1 > mav2 Then ExitShort("매도포지션청산"); 즐거운 하루되세요 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. input : P1(5),P2(20),ShortPeriod(12),LongPeriod(26), Period(9),N1(0),N2(0),loss(-1),entry(5); var : PredayPL(0),XCommission(0),XSlippage(0),dayPL(0),count(0),cnt(0); count = 0; dayPL = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then{ count=count+1; dayPL = daypl+PositionProfit(cnt); } } var1 = ma(c,P1); var2 = ma(C,P2); var3 = MACD(ShortPeriod,LongPeriod); var4 = ema(var3, Period); Condition1 = var1 > var2 and var3 >= var4; Condition2 = var3 > var4 and var1 >= var2; Condition3 = var1-var2 >= N1; Condition4 = var1 < var2 and var3 < var4; Condition5 = var3 < var4 and var1 < var2; Condition6 = var1-var2 <= N2; Condition7 = dayPL > Loss; Condition8 = count < entry; if stime == 151500 and MarketPosition == 0 Then{ if MarketPosition(1) == 1 Then buy("b",AtMarket); if MarketPosition(1) == -1 Then sell("s",AtMarket); } if (Condition1 or Condition2) and Condition3 and Condition7 and Condition8 Then buy("매수진입"); if Condition4 or Condition5 Then ExitLong("매수포지션청산"); if (Condition4 or Condition5) and Condition6 and Condition7 and Condition8 Then sell("매도진입"); if Condition1 or Condition2 Then ExitShort("매도포지션청산"); 즐거운 하루되세여 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 동그라미 친부분의 신호는 매수진입신호가 아닙니다. 매도포지션을 청산하는 exitshort신호입니다. 27일 첫봉에 매도로 진입하고 10시에서 11시 사이에 매도포지션을 청산한것입니다. 28일 첫신호는 어제 마지막 거래가 매도포지션이므로 발생한것입니다. 수식을 수정했습니다. 아래식 이용하시면 됩니다. input : P1(5),P2(20),ShortPeriod(12),LongPeriod(26), Period(9),N1(0),N2(0),loss(-1),entry(5); var : PredayPL(0),XCommission(0),XSlippage(0),dayPL(0),count(0),cnt(0); count = 0; dayPL = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then{ count=count+1; dayPL = daypl+PositionProfit(cnt); } } var1 = ma(c,P1); var2 = ma(C,P2); var3 = MACD(ShortPeriod,LongPeriod); var4 = ema(var3, Period); Condition1 = crossup(var1,var2) and var3 >= var4; Condition2 = CrossUP(var3,var4) and var1 >= var2; Condition3 = var1-var2 >= N1; Condition4 = CrossDown(var1,var2) and var3 < var4; Condition5 = Crossdown(var3,var4) and var1 < var2; Condition6 = var1-var2 <= N2; Condition7 = dayPL > Loss; Condition8 = count < entry; if stime == 151500 and MarketPosition == 0 Then{ if MarketPosition(1) == 1 Then buy("b",AtMarket); if MarketPosition(1) == -1 Then sell("s",AtMarket); } if (Condition1 or Condition2) and Condition3 and Condition7 and Condition8 Then buy("매수진입"); if Condition4 or Condition5 Then ExitLong("매수포지션청산"); if (Condition4 or Condition5) and Condition6 and Condition7 and Condition8 Then sell("매도진입"); if Condition1 or Condition2 Then ExitShort("매도포지션청산"); 즐거운 하루되세요 > 소주까기인형 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 안녕하세요 가르쳐 주신 수식을 이용해서 공부를 하고있습니다. 그런데 이해할수없는 현상이 생겨서 그림파일첨부해서 여쭤봅니다. 사용한 수식------------------------------ input : P1(5),P2(20),ShortPeriod(12),LongPeriod(26), Period(9),N1(0),N2(0),loss(-1),entry(5); var : PredayPL(0),XCommission(0),XSlippage(0),dayPL(0),count(0),cnt(0); #당일누적손익계산 시작 if date != date[1] Then PredayPL = NetProfit[1]; XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정 XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정 if MarketPosition() == 0 Then dayPL = (NetProfit-PredayPL); Else dayPL = (NetProfit-PredayPL)+(PositionProfit-(XCommission+XSlippage)); count = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then count=count+1; } var1 = ma(c,P1); var2 = ma(C,P2); var3 = MACD(ShortPeriod,LongPeriod); var4 = ema(var3, Period); Condition1 = crossup(var1,var2) and var3 >= var4; Condition2 = CrossUP(var3,var4) and var1 >= var2; Condition3 = var1-var2 >= N1; Condition4 = CrossDown(var1,var2) and var3 < var4; Condition5 = Crossdown(var3,var4) and var1 < var2; Condition6 = var1-var2 <= N2; Condition7 = dayPL > Loss; Condition8 = count < entry; if stime == 151500 and MarketPosition == 0 Then{ if MarketPosition(1) == 1 Then buy("b",AtMarket); if MarketPosition(1) == -1 Then sell("s",AtMarket); } if (Condition1 or Condition2) and Condition3 and Condition7 and Condition8 Then buy(); if Condition4 or Condition5 Then ExitLong(); if (Condition4 or Condition5) and Condition6 and Condition7 and Condition8 Then sell(); if Condition1 or Condition2 Then ExitShort();