커뮤니티

식변경 부탁드립니다(피라미딩)

프로필 이미지
머니사이언스
2015-01-10 11:12:54
173
글번호 82125
답변완료
수고하십니다.. 39846번에 문의한 것과 관련해서 아래식을 이용해서 data2로 선물을 기준으로 해서 풋옵션을 거래할려고 하는데 작동이 잘 안되네요.. 식 변경 부탁드립니다.. -------------------------------------------------------------- var:피봇(0),저항1(0),저항2(0),지지1(0),지지2(0), ilmok1(0), ilmok2(0), ilmok3(0), sunhang1(0), sunhang2(0), emaV(0),중기(0),중장기(0),장기(0), MacdV(0), MacdS(0), MacdOsc(0), LemaV(0), LmacdV(0), LmacdS(0), LmacdOsc(0),adxv(0),atrv(0),atrstop(0),cnt(0),posHigh(0), posLow(0); 피봇 = (DayHigh(1)+daylow(1)+dayclose(1))/3 ; 저항1 = 2 * 피봇 - daylow(1); 저항2 = 피봇 + DayHigh(1)-DayLow(1); 지지1 = 2 * 피봇 - DayHigh(1); 지지2 = 피봇 - DayHigh(1) + DayLow(1); 중기=ema(c,15); 중장기=ema(c,30); 장기=ema(c,400); adxv=adx(20); atrv=atr(10); atrstop=iff(adxv>25 and adxv>adxv[1],atrv*2,atrv*10); var1 = Highest(h,BarsSinceEntry+1); var2 = Lowest(L,BarsSinceEntry+1); #1 macd + ema emaV = ema(C,300); MacdV = macd(20,76); MacdS = ema(MacdV,190); MacdOsc = MacdV-MacdS; #2 #1을 다시 변형 LemaV = ema(C,300*1.8); LmacdV = macd(20*1.8,76*1.8); LmacdS = ema(MacdV*1.8,190*1.8); LmacdOsc = (LmacdV-LmacdS)*1.8; If sTime>=091500 and CrossDown(C,지지2) then { if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then Sell("사번sell"); } if stime>=092000 and CrossDown(c, 저항1) then { if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then Sell("이번sell"); } if IsEntryName("사번sell") Then { ExitShort("사번atrES",AtStop, Var2+ATRstop); if CrossUp(c,중기) then ExitShort("사번2ES"); } if IsEntryName("이번sell") then { ExitShort("이번atrES", AtStop, Var2+ATRstop); If CrossUp(c,피봇)and c<EntryPrice then ExitShort("이번2es"); } ilmok1 = (highest(H,15)+lowest(L,15))/2; ilmok2 = (highest(H,15*3)+lowest(L,15*3))/2; ilmok3 = (highest(H,15*3*2)+lowest(L,15*3*2))/2; sunhang1 = (ilmok1+ilmok2)/2 ;// "선행스팬1" sunhang2 = ilmok3; // "선행스팬2" if dayindex() == 23+1 then { if accumN(iff( C < min(sunhang1, sunhang2),1,0), 14) == 14 then { if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then sell("육번Sell"); } } if isEntryname("육번Sell") then { if CrossUp(C, min(sunhang1, sunhang2)) Then exitshort("육번es1"); if MarketPosition == -1 then ExitShort("6익절", atlimit, EntryPrice-4); } if CrossDown(ema(c,30), ema(c,580)) then { if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then sell("팔번Sell"); } if IsEntryName("팔번Sell") Then { ExitShort("팔번atres",AtStop, Var2+ATRstop);} # 매도진입 If stime >=090500 and LemaV < LemaV[1] then { if Crossdown(C, emaV) Then{ if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then sell("십번sell"); } } if IsEntryName("십번sell") Then {ExitShort("십번atres",AtStop, Var2+ATRstop); } SetStopLoss(0.6,PointStop); SetStopEndofday(144200);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-01-12 11:30:07

안녕하세요 예스스탁입니다. 참조데이터를 이용해 주종목에 신호를 발생하는 식으로 돌리시면 모든 조건을 봉완성시로 사용하셔야 합니다. 1.수식의 신호타입으로 사용하시면 atstop/atlimit은 지정된 가격과 주종목의 현재가만 비교하므로 참조데이터를 이용해서는 구현이 되지 않습니다. 2. 강제청산 또한 주종목을 기준으로 하면 봉완성시로 풀어서 작성하셔야 합니다. 3. 함수중 LatestEntryPrice같은 함수도 주종목의 값이므로 data2로 구현해서 사용해야 합니다. 아래식 참고하시기 바랍니다. var:피봇(0,data2),저항1(0,data2),저항2(0,data2),지지1(0,data2),지지2(0,data2), ilmok1(0,data2), ilmok2(0,data2), ilmok3(0,data2), sunhang1(0,data2), sunhang2(0,data2), emaV(0,data2),중기(0,data2),중장기(0,data2),장기(0,data2), MacdV(0,data2), MacdS(0,data2), MacdOsc(0,data2), LemaV(0,data2), LmacdV(0,data2), LmacdS(0,data2), LmacdOsc(0,data2),adxv(0,data2), atrv(0,data2),atrstop(0,data2),cnt(0,data2),posHigh(0,data2), posLow(0,data2); var : LatestEPrice(0,data2),H2(0,data1),L2(0,data1),C2(0,data2); 피봇 = data2((HighD(1)+lowD(1)+closeD(1))/3); 저항1 = data2(2 * 피봇 - lowD(1)); 저항2 = data2(피봇 + HighD(1)-LowD(1)); 지지1 = data2(2 * 피봇 - HighD(1)); 지지2 = data2(피봇 - HighD(1) + LowD(1)); 중기 = data2(ema(c,15)); 중장기 = data2(ema(c,30)); 장기 = data2(ema(c,400)); adxv = data2(adx(20)); atrv = data2(atr(10)); atrstop = data2(iff(adxv>25 and adxv>adxv[1],atrv*2,atrv*10)); H2 = data2(H); L2 = data2(L); C2 = data2(C); var1 = Highest(H2,BarsSinceEntry+1); var2 = Lowest(L2,BarsSinceEntry+1); #1 macd + ema emaV = data2(ema(C,300)); MacdV = data2(macd(20,76)); MacdS = data2(ema(MacdV,190)); MacdOsc = data2(MacdV-MacdS); #2 #1을 다시 변형 LemaV = data2(ema(C,300*1.8)); LmacdV = data2(macd(20*1.8,76*1.8)); LmacdS = data2(ema(MacdV*1.8,190*1.8)); LmacdOsc = data2((LmacdV-LmacdS)*1.8); if MarketPosition != 0 and CurrentContracts > CurrentContracts[1] Then LatestEPrice = data2(C[1]); If data2(sTime>=091500 and CrossDown(C,지지2)) then { if MarketPosition == 0 or (MarketPosition == -1 and data2(C) <= LatestEPrice-1) Then Sell("사번sell"); } if data2(stime>=092000 and CrossDown(c, 저항1)) then { if MarketPosition == 0 or (MarketPosition == -1 and data2(C) <= LatestEPrice-1) Then Sell("이번sell"); } if IsEntryName("사번sell") Then { if data2(H) >= var2[1]+ATRstop[1] Then ExitShort("사번atrES"); if data2(CrossUp(c,중기)) then ExitShort("사번2ES"); } if IsEntryName("이번sell") then { if data2(H) >= var2[1]+ATRstop[1] Then ExitShort("이번atrES"); If data2(CrossUp(c,피봇)) and c < C2[BarsSinceEntry] then ExitShort("이번2es"); } ilmok1 = data2((highest(H,15)+lowest(L,15))/2); ilmok2 = data2((highest(H,15*3)+lowest(L,15*3))/2); ilmok3 = data2((highest(H,15*3*2)+lowest(L,15*3*2))/2); sunhang1 = data2((ilmok1+ilmok2)/2) ;// "선행스팬1" sunhang2 = data2(ilmok3); // "선행스팬2" if data2(dayindex() == 23+1) then { if data2(accumN(iff( C < min(sunhang1, sunhang2),1,0), 14) == 14) then { if MarketPosition == 0 or (MarketPosition == -1 and data2(C) <= LatestEPrice-1) Then sell("육번Sell"); } } if isEntryname("육번Sell") then { if data2(CrossUp(C, min(sunhang1, sunhang2))) Then exitshort("육번es1"); if MarketPosition == -1 and L <= C2[BarsSinceEntry]-4 then ExitShort("6익절"); } if data2(CrossDown(ema(c,30), ema(c,580))) then { if MarketPosition == 0 or (MarketPosition == -1 and data2(C) <= LatestEPrice-1) Then sell("팔번Sell"); } if IsEntryName("팔번Sell") Then { if data2(H) >= var2[1]+AtrStop[1] Then ExitShort("팔번atres",AtStop, Var2+ATRstop); } # 매도진입 If data2(stime >=090500 and LemaV < LemaV[1]) then { if data2(Crossdown(C, emaV)) Then{ if MarketPosition == 0 or (MarketPosition == -1 and data2(C) <= LatestEPrice-1) Then sell("십번sell"); } } if IsEntryName("십번sell") Then{ if data2(H) >= var2[1]+AtrStop[1] Then ExitShort("십번atres"); } SetStopLoss(0.6,PointStop); SetStopEndofday(144200); 즐거운 하루되세요 > 머니사이언스 님이 쓴 글입니다. > 제목 : 식변경 부탁드립니다(피라미딩) > 수고하십니다.. 39846번에 문의한 것과 관련해서 아래식을 이용해서 data2로 선물을 기준으로 해서 풋옵션을 거래할려고 하는데 작동이 잘 안되네요.. 식 변경 부탁드립니다.. -------------------------------------------------------------- var:피봇(0),저항1(0),저항2(0),지지1(0),지지2(0), ilmok1(0), ilmok2(0), ilmok3(0), sunhang1(0), sunhang2(0), emaV(0),중기(0),중장기(0),장기(0), MacdV(0), MacdS(0), MacdOsc(0), LemaV(0), LmacdV(0), LmacdS(0), LmacdOsc(0),adxv(0),atrv(0),atrstop(0),cnt(0),posHigh(0), posLow(0); 피봇 = (DayHigh(1)+daylow(1)+dayclose(1))/3 ; 저항1 = 2 * 피봇 - daylow(1); 저항2 = 피봇 + DayHigh(1)-DayLow(1); 지지1 = 2 * 피봇 - DayHigh(1); 지지2 = 피봇 - DayHigh(1) + DayLow(1); 중기=ema(c,15); 중장기=ema(c,30); 장기=ema(c,400); adxv=adx(20); atrv=atr(10); atrstop=iff(adxv>25 and adxv>adxv[1],atrv*2,atrv*10); var1 = Highest(h,BarsSinceEntry+1); var2 = Lowest(L,BarsSinceEntry+1); #1 macd + ema emaV = ema(C,300); MacdV = macd(20,76); MacdS = ema(MacdV,190); MacdOsc = MacdV-MacdS; #2 #1을 다시 변형 LemaV = ema(C,300*1.8); LmacdV = macd(20*1.8,76*1.8); LmacdS = ema(MacdV*1.8,190*1.8); LmacdOsc = (LmacdV-LmacdS)*1.8; If sTime>=091500 and CrossDown(C,지지2) then { if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then Sell("사번sell"); } if stime>=092000 and CrossDown(c, 저항1) then { if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then Sell("이번sell"); } if IsEntryName("사번sell") Then { ExitShort("사번atrES",AtStop, Var2+ATRstop); if CrossUp(c,중기) then ExitShort("사번2ES"); } if IsEntryName("이번sell") then { ExitShort("이번atrES", AtStop, Var2+ATRstop); If CrossUp(c,피봇)and c<EntryPrice then ExitShort("이번2es"); } ilmok1 = (highest(H,15)+lowest(L,15))/2; ilmok2 = (highest(H,15*3)+lowest(L,15*3))/2; ilmok3 = (highest(H,15*3*2)+lowest(L,15*3*2))/2; sunhang1 = (ilmok1+ilmok2)/2 ;// "선행스팬1" sunhang2 = ilmok3; // "선행스팬2" if dayindex() == 23+1 then { if accumN(iff( C < min(sunhang1, sunhang2),1,0), 14) == 14 then { if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then sell("육번Sell"); } } if isEntryname("육번Sell") then { if CrossUp(C, min(sunhang1, sunhang2)) Then exitshort("육번es1"); if MarketPosition == -1 then ExitShort("6익절", atlimit, EntryPrice-4); } if CrossDown(ema(c,30), ema(c,580)) then { if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then sell("팔번Sell"); } if IsEntryName("팔번Sell") Then { ExitShort("팔번atres",AtStop, Var2+ATRstop);} # 매도진입 If stime >=090500 and LemaV < LemaV[1] then { if Crossdown(C, emaV) Then{ if MarketPosition == 0 or (MarketPosition == -1 and C <= LatestEntryPrice(0)-1) Then sell("십번sell"); } } if IsEntryName("십번sell") Then {ExitShort("십번atres",AtStop, Var2+ATRstop); } SetStopLoss(0.6,PointStop); SetStopEndofday(144200);