커뮤니티

수식문의드립니다

프로필 이미지
뎅이요
2019-04-23 13:49:44
235
글번호 128054
답변완료
아래 청산수식1, 2를 예스트레이더에 사용할수 있게 변경 부탁 드립니다 청산수식 1 Param : Period(60), Period1(5), Period2(10); Vars : oTEMA(0); v99 = (H + L + C ) / 3; V1 = wAverage(v99, Period); oTEMA = ema(ema(ema(c, Period1), Period1), Period1); V2 = highestsince(Period2, oTEMA > oTEMA[1], oTEMA); V0 = (V1 + V2)/2; Cond1 = CrossDown(C, v0); If COND1 Then ExitLong(); 청산수식 2 Params : Period(5), Period0(10), Period1(14), SignalPeriod(9); Vars : TickSize(0), bCNT0(0), bCNT1(0), bCNT2(0); Vars : SP(0), entryVol(0), ExBlockCOND(False), blockCond(True); Vars : MA1(0), HH(0), LL(0), hNUM(0), lNUM(0), DownTrend(False); Ticksize = onetick * pricescale; v99 = (H + L + C + O) / 4; v1 = wAverage(v99, Period); v2 = triAverage(v99, Period0); Cond1 = CrossDown(v1 , v2); MA1 = (wAverage(v99, Period1) + Average(v99, Period1))/2; If MA1[2] > MA1[1] And MA1[1] < MA1 Then LL = MA1; If MA1[2] < MA1[1] And MA1[1] > MA1 Then HH = MA1; If HH[1] <> HH Or LL[1] <> LL Then Begin hNUM = 0; lNum = 0; End; If MA1[1] < MA1 Then lNum = lNUM + 1; If MA1[1] > MA1 Then hNum = hNUM - 1; v5 = Average(lNum, SignalPeriod); Cond7 = CrossDown(lNum , V5); If Cond1 and Cond7 Then Exitlong("청산"); SetBreakEven(6 * TIckSize * cUrrentContracts); SetStopTrailing(10 * TickSize * CurrentContracts, 15 * TickSize * Currentcontracts); SP = SignalPosition; If SP <> SP[1] And SP <> 0 Then entryVol = CurrentContracts; If EntryPrice <> 0 Then Begin If SP = 1 Then Begin If maxcontractprofit > (4 * TickSize) Then bCNT0 = bCNT0 + 1 Else If maxcontractprofit > (3 * TickSize) Then bCNT1 = bCNT1 + 1 Else If maxcontractprofit > (2 * TickSize) Then bCNT2 = bCNT2 + 1; End; End Else Begin bCNT0 = 0; bCNT1 = 0; bCNT2 = 0; End; If bCNT0 >= 1 And H > EntryPrice - TickSize Then ExitLong("E_1", atstop, EntryPrice - TickSize) Else IF bCNT1 >= 1 And H > EntryPrice - (2 * TickSize) Then Exitlong("E_2", AtStop, EntryPrice - (2 * TIckSIze)) Else If bCNT2 >= 1 And H > EntryPrice - (3 * Ticksize) Then ExitLong("E_3", AtStop, EntryPrice - (3 * TickSize)); If CurrentContracts = entryVol And (False = ExBlockCOND) And (H < EntryPrice + (5 * TickSize)) Then ExitLong("청산1", Atlimit, EntryPrice + (5 * TickSize), DEF, 1);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-04-24 09:36:20

안녕하세요 예스스탁입니다. 1 input : Period(60), Period1(5), Period2(10); Vars : oTEMA(0),v99(0),v1(0),v2(0),v0(0),cnt(0),cond1(false); Array : HS[99](0); v99 = (H + L + C ) / 3; V1 = wma(v99, Period); oTEMA = ema(ema(ema(c, Period1), Period1), Period1); if oTEMA > oTEMA[1] Then { HS[0] = oTEMA; for cnt = 1 to 99 { HS[cnt] = HS[cnt-1][1]; } } if HS[0] > 0 and oTEMA > HS[0] Then HS[0] = oTEMA; V2 = hS[Period2]; V0 = (V1 + V2)/2; Cond1 = CrossDown(C, v0); If COND1 Then ExitLong(); 2 input : Period(5), Period0(10), Period1(14), SignalPeriod(9); Vars : TickSize(0), bCNT0(0), bCNT1(0), bCNT2(0); Vars : SP(0), entryVol(0), ExBlockCOND(False), blockCond(True); Vars : MA1(0), HH(0), LL(0), hNUM(0), lNUM(0), DownTrend(False); var : v99(0),v1(0),v2(0),cond1(false),v5(0),cond7(false); Ticksize = pricescale; v99 = (H + L + C + O) / 4; v1 = wma(v99, Period); var1 = Ceiling((Period0 + 1) * .5); v2 = ma(ma(v99, var1), var1); Cond1 = CrossDown(v1 , v2); MA1 = (wma(v99, Period1) + ma(v99, Period1))/2; If MA1[2] > MA1[1] And MA1[1] < MA1 Then LL = MA1; If MA1[2] < MA1[1] And MA1[1] > MA1 Then HH = MA1; If HH[1] <> HH Or LL[1] <> LL Then Begin hNUM = 0; lNum = 0; End; If MA1[1] < MA1 Then lNum = lNUM + 1; If MA1[1] > MA1 Then hNum = hNUM - 1; v5 = ma(lNum, SignalPeriod); Cond7 = CrossDown(lNum , V5); If Cond1 and Cond7 Then Exitlong("청산"); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+6 * TIckSize *Currentcontracts Then ExitLong("bx",AtStop,EntryPrice); if MarketPosition == 1 and Lowest(L,BarsSinceEntry) <= EntryPrice-6 * TIckSize *Currentcontracts Then ExitShort("sx",AtStop,EntryPrice); SetStopTrailing(10 * TickSize * CurrentContracts, 15 * TickSize * Currentcontracts,PointStop); SP = MarketPosition; If SP <> SP[1] And SP <> 0 Then entryVol = CurrentContracts; If EntryPrice <> 0 Then Begin If SP == 1 Then Begin If MaxPositionProfit/CurrentContracts > (4 * TickSize) Then bCNT0 = bCNT0 + 1; Else If MaxPositionProfit/CurrentContracts > (3 * TickSize) Then bCNT1 = bCNT1 + 1; Else If MaxPositionProfit/CurrentContracts > (2 * TickSize) Then bCNT2 = bCNT2 + 1; End; End Else Begin bCNT0 = 0; bCNT1 = 0; bCNT2 = 0; End; If bCNT0 >= 1 And H > EntryPrice - TickSize Then ExitLong("E_1", atstop, EntryPrice - TickSize); Else IF bCNT1 >= 1 And H > EntryPrice - (2 * TickSize) Then Exitlong("E_2", AtStop, EntryPrice - (2 * TIckSIze)); Else If bCNT2 >= 1 And H > EntryPrice - (3 * Ticksize) Then ExitLong("E_3", AtStop, EntryPrice - (3 * TickSize)); If CurrentContracts == entryVol And (False == ExBlockCOND) And (H < EntryPrice + (5 * TickSize)) Then ExitLong("청산1", Atlimit, EntryPrice + (5 * TickSize), DEF, 1); 즐거운 하루되세요 > 뎅이요 님이 쓴 글입니다. > 제목 : 수식문의드립니다 > 아래 청산수식1, 2를 예스트레이더에 사용할수 있게 변경 부탁 드립니다 청산수식 1 Param : Period(60), Period1(5), Period2(10); Vars : oTEMA(0); v99 = (H + L + C ) / 3; V1 = wAverage(v99, Period); oTEMA = ema(ema(ema(c, Period1), Period1), Period1); V2 = highestsince(Period2, oTEMA > oTEMA[1], oTEMA); V0 = (V1 + V2)/2; Cond1 = CrossDown(C, v0); If COND1 Then ExitLong(); 청산수식 2 Params : Period(5), Period0(10), Period1(14), SignalPeriod(9); Vars : TickSize(0), bCNT0(0), bCNT1(0), bCNT2(0); Vars : SP(0), entryVol(0), ExBlockCOND(False), blockCond(True); Vars : MA1(0), HH(0), LL(0), hNUM(0), lNUM(0), DownTrend(False); Ticksize = onetick * pricescale; v99 = (H + L + C + O) / 4; v1 = wAverage(v99, Period); v2 = triAverage(v99, Period0); Cond1 = CrossDown(v1 , v2); MA1 = (wAverage(v99, Period1) + Average(v99, Period1))/2; If MA1[2] > MA1[1] And MA1[1] < MA1 Then LL = MA1; If MA1[2] < MA1[1] And MA1[1] > MA1 Then HH = MA1; If HH[1] <> HH Or LL[1] <> LL Then Begin hNUM = 0; lNum = 0; End; If MA1[1] < MA1 Then lNum = lNUM + 1; If MA1[1] > MA1 Then hNum = hNUM - 1; v5 = Average(lNum, SignalPeriod); Cond7 = CrossDown(lNum , V5); If Cond1 and Cond7 Then Exitlong("청산"); SetBreakEven(6 * TIckSize * cUrrentContracts); SetStopTrailing(10 * TickSize * CurrentContracts, 15 * TickSize * Currentcontracts); SP = SignalPosition; If SP <> SP[1] And SP <> 0 Then entryVol = CurrentContracts; If EntryPrice <> 0 Then Begin If SP = 1 Then Begin If maxcontractprofit > (4 * TickSize) Then bCNT0 = bCNT0 + 1 Else If maxcontractprofit > (3 * TickSize) Then bCNT1 = bCNT1 + 1 Else If maxcontractprofit > (2 * TickSize) Then bCNT2 = bCNT2 + 1; End; End Else Begin bCNT0 = 0; bCNT1 = 0; bCNT2 = 0; End; If bCNT0 >= 1 And H > EntryPrice - TickSize Then ExitLong("E_1", atstop, EntryPrice - TickSize) Else IF bCNT1 >= 1 And H > EntryPrice - (2 * TickSize) Then Exitlong("E_2", AtStop, EntryPrice - (2 * TIckSIze)) Else If bCNT2 >= 1 And H > EntryPrice - (3 * Ticksize) Then ExitLong("E_3", AtStop, EntryPrice - (3 * TickSize)); If CurrentContracts = entryVol And (False = ExBlockCOND) And (H < EntryPrice + (5 * TickSize)) Then ExitLong("청산1", Atlimit, EntryPrice + (5 * TickSize), DEF, 1);