커뮤니티

수식 변경요청 드립니다.

프로필 이미지
dandy
2015-07-05 17:54:58
146
글번호 87999
답변완료
수식1, 수식2 변경요청 드립니다. 수식1 아래 수식에서 2번째 신호발생봉 종가기준 -> 손실 -1PT 이상 발생시 당일손실 제한적용으로 강제청산 -> 수익 +1PT 이상 발생시 [수익보전 추적청산 수식]으로 강제청산(진입횟수 추가적용) => [수익보전 추적청산 수식] -> +1PT 이상 수익이 발생 후, 수익이 30% 감소시 강제청산 수정요청 드립니다. input :N(2),당일손실(-1.5); var : cnt(0),BCount(0),SCount(0); var : NP(0),PreNP(0),DayPL(0); NP = NetProfit; if date != date[1] Then preNP = NP[1]; dayPL = NP-PreNP; BCount = 0 ; SCount = 0 ; for cnt = 0 to 10 { if EntryDate(cnt) == sdate and MarketPosition(cnt) == 1 then BCount = BCount + 1; if EntryDate(cnt) == sdate and MarketPosition(cnt) == -1 then SCount = SCount + 1; } //------------------------------------------------------------------------------- if MarketPosition == 1 Then{ if BCount+SCount == 1 Then ExitLong("당일손실제한bx3",AtStop,EntryPrice+당일손실-dayPL); if BCount+SCount == 2 Then { if PositionProfit(1) > 0 Then ExitLong("당일손실제한bx31",AtStop,EntryPrice-당일손실); Else ExitLong("당일손실제한bx32",AtStop,EntryPrice+당일손실-dayPL); } } if MarketPosition == -1 Then{ if BCount+SCount == 1 then ExitShort("당일손실제한sx3",AtStop,EntryPrice-당일손실+daypl ); if BCount+SCount == 2 Then { if PositionProfit(1) > 0 Then ExitShort("당일손실제한sx31",AtStop,EntryPrice+당일손실); Else ExitShort("당일손실제한sx32",AtStop,EntryPrice-당일손실+daypl ); } } //----------------------------------------------------------------------------------------------------- if MarketPosition == -1 and crossup(H,EntryPrice+0.5) and BCount+SCount < N and dayPL > 당일손실 Then buy("1BX"); if MarketPosition == 1 and CrossDown(L,EntryPrice-0.5) and BCount+SCount < N and dayPL > 당일손실 Then sell("1SX"); //---------------------------------------------------------------------------------------------------- Value1 = Highest(H, BarsSinceEntry-100); if BCount+SCount < N and daypl > 당일손실 Then Buy("매수추적청산",AtStop, Value1-ATR(15)*5); Value2 = Lowest(L, BarsSinceEntry-100); if BCount+SCount < N and daypl > 당일손실 Then sell("매도추적청산",AtStop, Value2-ATR(15)*5); //---------------------------------------------------- 수식2 키움수식 예스수식으로 변경요청 드립니다. #1 매수 a=MACD(shortPeriod,longPeriod)>= eavg(MACD(shortPeriod,longPeriod),sigPeriod), CrossUp(H,BBandsUp(Period1,D1)) and (L(3)<L(2)<L(1)); d=Crossup(Trix(period),eavg(Trix(period),sigperiod10)); if(time >= 090000 && time <= 090130,CrossUp(valuewhen(1,date(1) != date,C),PreDayClose()),a or d) #2 매도 a=CrossDown((highest(H,shortPeriod)+lowest(L,shortPeriod))/2,(highest(H,midPeriod)+lowest(L,midPeriod))/2) and (H(3)<H(2)<H(1)), MACD(shortPeriod,longPeriod) < eavg(MACD(shortPeriod,longPeriod),sigPeriod) and CrossDown(L,BBandsDown(Period1,D1)); d=CrossDown(Trix(period),eavg(Trix(period),sigperiod10)); if(time >= 090000 && time <= 090130,CrossDown(valuewhen(1,date(1) != date,C),PreDayClose()),a or d) // 이하생략 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-07-06 13:47:16

안녕하세요 예스스탁입니다. 1. input :N(2),당일손실(-1.5); var : cnt(0),BCount(0),SCount(0); var : NP(0),PreNP(0),DayPL(0); NP = NetProfit; if date != date[1] Then preNP = NP[1]; dayPL = NP-PreNP; BCount = 0 ; SCount = 0 ; for cnt = 0 to 10 { if EntryDate(cnt) == sdate and MarketPosition(cnt) == 1 then BCount = BCount + 1; if EntryDate(cnt) == sdate and MarketPosition(cnt) == -1 then SCount = SCount + 1; } //------------------------------------------------------------------------------- if MarketPosition == 1 Then{ if BCount+SCount == 1 Then ExitLong("당일손실제한bx3",AtStop,EntryPrice+당일손실-dayPL); if BCount+SCount == 2 Then { if PositionProfit(1) >= 1 Then ExitLong("당일손실제한bx31",AtStop,EntryPrice-당일손실); Else ExitLong("당일손실제한bx32",AtStop,EntryPrice+당일손실-dayPL); if highest(H,BarsSinceEntry) >= EntryPrice+1 Then ExitLong("Btr",AtStop,highest(H,BarsSinceEntry)-(highest(h,BarsSinceEntry)-EntryPrice)*0.3); } } if MarketPosition == -1 Then{ if BCount+SCount == 1 then ExitShort("당일손실제한sx3",AtStop,EntryPrice-당일손실+daypl ); if BCount+SCount == 2 Then { if PositionProfit(1) >= 1 Then ExitShort("당일손실제한sx31",AtStop,latestEntryPrice+당일손실); Else ExitShort("당일손실제한sx32",AtStop,latestEntryPrice-당일손실+daypl ); if Lowest(L,BarsSinceEntry) <= EntryPrice-1 Then ExitShort("Str",AtStop,Lowest(L,BarsSinceEntry)+(EntryPrice-Lowest(L,BarsSinceEntry))*0.3); } } //----------------------------------------------------------------------------------------------------- if MarketPosition == -1 and crossup(H,EntryPrice+0.5) and BCount+SCount < N and dayPL > 당일손실 Then buy("1BX"); if MarketPosition == 1 and CrossDown(L,EntryPrice-0.5) and BCount+SCount < N and dayPL > 당일손실 Then sell("1SX"); //---------------------------------------------------------------------------------------------------- Value1 = Highest(H, BarsSinceEntry-100); if BCount+SCount < N and daypl > 당일손실 Then Buy("매수추적청산",AtStop, Value1-ATR(15)*5); Value2 = Lowest(L, BarsSinceEntry-100); if BCount+SCount < N and daypl > 당일손실 Then sell("매도추적청산",AtStop, Value2-ATR(15)*5); //---------------------------------------------------- 2. 키움수식 내용 글로 풀어서 설명을 올려주시기 바랍니다. 사용하지 않는 언어라 조건 연결 구조를 명확히 모르겠습니다. 즐거운 하루되세요 > dandy 님이 쓴 글입니다. > 제목 : 수식 변경요청 드립니다. > 수식1, 수식2 변경요청 드립니다. 수식1 아래 수식에서 2번째 신호발생봉 종가기준 -> 손실 -1PT 이상 발생시 당일손실 제한적용으로 강제청산 -> 수익 +1PT 이상 발생시 [수익보전 추적청산 수식]으로 강제청산(진입횟수 추가적용) => [수익보전 추적청산 수식] -> +1PT 이상 수익이 발생 후, 수익이 30% 감소시 강제청산 수정요청 드립니다. input :N(2),당일손실(-1.5); var : cnt(0),BCount(0),SCount(0); var : NP(0),PreNP(0),DayPL(0); NP = NetProfit; if date != date[1] Then preNP = NP[1]; dayPL = NP-PreNP; BCount = 0 ; SCount = 0 ; for cnt = 0 to 10 { if EntryDate(cnt) == sdate and MarketPosition(cnt) == 1 then BCount = BCount + 1; if EntryDate(cnt) == sdate and MarketPosition(cnt) == -1 then SCount = SCount + 1; } //------------------------------------------------------------------------------- if MarketPosition == 1 Then{ if BCount+SCount == 1 Then ExitLong("당일손실제한bx3",AtStop,EntryPrice+당일손실-dayPL); if BCount+SCount == 2 Then { if PositionProfit(1) > 0 Then ExitLong("당일손실제한bx31",AtStop,EntryPrice-당일손실); Else ExitLong("당일손실제한bx32",AtStop,EntryPrice+당일손실-dayPL); } } if MarketPosition == -1 Then{ if BCount+SCount == 1 then ExitShort("당일손실제한sx3",AtStop,EntryPrice-당일손실+daypl ); if BCount+SCount == 2 Then { if PositionProfit(1) > 0 Then ExitShort("당일손실제한sx31",AtStop,EntryPrice+당일손실); Else ExitShort("당일손실제한sx32",AtStop,EntryPrice-당일손실+daypl ); } } //----------------------------------------------------------------------------------------------------- if MarketPosition == -1 and crossup(H,EntryPrice+0.5) and BCount+SCount < N and dayPL > 당일손실 Then buy("1BX"); if MarketPosition == 1 and CrossDown(L,EntryPrice-0.5) and BCount+SCount < N and dayPL > 당일손실 Then sell("1SX"); //---------------------------------------------------------------------------------------------------- Value1 = Highest(H, BarsSinceEntry-100); if BCount+SCount < N and daypl > 당일손실 Then Buy("매수추적청산",AtStop, Value1-ATR(15)*5); Value2 = Lowest(L, BarsSinceEntry-100); if BCount+SCount < N and daypl > 당일손실 Then sell("매도추적청산",AtStop, Value2-ATR(15)*5); //---------------------------------------------------- 수식2 키움수식 예스수식으로 변경요청 드립니다. #1 매수 a=MACD(shortPeriod,longPeriod)>= eavg(MACD(shortPeriod,longPeriod),sigPeriod), CrossUp(H,BBandsUp(Period1,D1)) and (L(3)<L(2)<L(1)); d=Crossup(Trix(period),eavg(Trix(period),sigperiod10)); if(time >= 090000 && time <= 090130,CrossUp(valuewhen(1,date(1) != date,C),PreDayClose()),a or d) #2 매도 a=CrossDown((highest(H,shortPeriod)+lowest(L,shortPeriod))/2,(highest(H,midPeriod)+lowest(L,midPeriod))/2) and (H(3)<H(2)<H(1)), MACD(shortPeriod,longPeriod) < eavg(MACD(shortPeriod,longPeriod),sigPeriod) and CrossDown(L,BBandsDown(Period1,D1)); d=CrossDown(Trix(period),eavg(Trix(period),sigperiod10)); if(time >= 090000 && time <= 090130,CrossDown(valuewhen(1,date(1) != date,C),PreDayClose()),a or d) // 이하생략 감사합니다.