커뮤니티

안녕하세세요

프로필 이미지
수원
2018-03-27 11:58:10
274
글번호 117722
답변완료
아래식에서 하루손절익절후 매매매정지식인데 계속 진입합니다 잘못된 부분 수정부탁합니다 첫번째식 Input : shortPeriod(100), longPeriod(200); Input : 당일손실틱수(800),당일수익틱수(800); value1 = ma(C, shortPeriod); value2 =ma(C, longPeriod); var : DH(0),DL(0); var : HH(0),LL(0),T1(0),entry(0); var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0); 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일손실틱수; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) Then{ Condition1 = true; DH = H; DL = L; } if Condition1 == true then{ if H > DH Then DH = H; if L < DL Then DL = L; } if stime == 101500 or (stime > 101500 and stime[1] < 101500) Then { HH = H; LL = L; T1 = TotalTrades; } if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; if stime >= 104500 and stime < 113000 then{ if H > HH Then HH = H; if L < LL Then LL = L; if HH >= LL+PriceScale*10 and entry < 20 then { if DL > 0 and C < DL+PriceScale*300 and crossup(value1,value2) Then buy(); if DH > 0 and C > DH-PriceScale*300 and CrossDown(value1,value2) Then sell(); } } SetStopLoss(PriceScale*30,PointStop); SetStopProfittarget(PriceScale*60,PointStop); if MarketPosition == 1 Then{ HH = highest(H,BarsSinceEntry); if HH >= EntryPrice+PriceScale*39 and HH < EntryPrice+PriceScale*44 Then ExitLong("수청0",AtStop,EntryPrice+PriceScale*0); if HH >= EntryPrice+PriceScale*50 and HH < EntryPrice+PriceScale*55 Then ExitLong("수청1",AtStop,EntryPrice+PriceScale*15); if HH >= EntryPrice+PriceScale*44 and HH < EntryPrice+PriceScale*50 Then ExitLong("수청2",AtStop,EntryPrice+PriceScale*7); if HH >= EntryPrice+PriceScale*55 and HH < EntryPrice+PriceScale*60 Then ExitLong("수청3",AtStop,EntryPrice+PriceScale*25); if HH >= EntryPrice+PriceScale*60 and HH < EntryPrice+PriceScale*70 Then ExitLong("수청4",AtStop,EntryPrice+PriceScale*40); if HH >= EntryPrice+PriceScale*70 and HH < EntryPrice+PriceScale*80 Then ExitLong("수청5",AtStop,EntryPrice+PriceScale*50); if HH >= EntryPrice+PriceScale*80 and HH < EntryPrice+PriceScale*90 Then ExitLong("수청6",AtStop,EntryPrice+PriceScale*60); if HH >= EntryPrice+PriceScale*90 and HH < EntryPrice+PriceScale*1200 Then ExitLong("수청7",AtStop,EntryPrice+PriceScale*70); } if MarketPosition == -1 Then{ LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*39 and LL > EntryPrice-PriceScale*44 Then Exitshort("도청0",AtStop,EntryPrice-PriceScale*0); LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*50 and LL > EntryPrice-PriceScale*55 Then Exitshort("도청1",AtStop,EntryPrice-PriceScale*15); LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*44 and LL > EntryPrice-PriceScale*50 Then Exitshort("도청2",AtStop,EntryPrice-PriceScale* 7); if LL <= EntryPrice-PriceScale*55 and LL > EntryPrice-PriceScale*90 Then Exitshort("도청3",AtStop,EntryPrice-PriceScale* 25); if LL <= EntryPrice-PriceScale*60 and LL > EntryPrice-PriceScale*70 Then Exitshort("도청4",AtStop,EntryPrice-PriceScale* 40); if LL <= EntryPrice-PriceScale*70 and LL > EntryPrice-PriceScale*80 Then Exitshort("도청5",AtStop,EntryPrice-PriceScale* 50); if LL <= EntryPrice-PriceScale*80 and LL > EntryPrice-PriceScale*90 Then Exitshort("도청6",AtStop,EntryPrice-PriceScale* 60); if LL <= EntryPrice-PriceScale*90 and LL > EntryPrice-PriceScale*1000 Then Exitshort("도청7",AtStop,EntryPrice-PriceScale* 70); } if MarketPosition == 10 then{ ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } 두번째식 Inputs: Length(5), Consec(3); Input : 당일손실틱수(500),당일수익틱수(500); var : DH(0),DL(0); var : HH(0),LL(0),T1(0),entry(0); var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0); 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일손실틱수; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) Then{ Condition1 = true; DH = H; DL = L; } if Condition1 == true then{ if H > DH Then DH = H; if L < DL Then DL = L; } If DL > 0 and C < DL+PriceScale*300 and stime > 104000 and stime < 115000 and CountIf(Close > Highest(High, Length)[1], Consec) == Consec Then Buy ("매수"); If DH > 0 and C > DH-PriceScale*300 and stime > 104000 and stime < 115000 and CountIf(Close < Lowest(Low, Length)[1], Consec) == Consec Then Sell ("매도"); SetStopLoss(PriceScale*60,PointStop); SetStopProfittarget(PriceScale*110,PointStop); if MarketPosition == 1 Then{ HH = highest(H,BarsSinceEntry); if HH >= EntryPrice+PriceScale*70 and HH < EntryPrice+PriceScale*80 Then ExitLong("bx1",AtStop,EntryPrice+PriceScale*20); if HH >= EntryPrice+PriceScale*80 and HH < EntryPrice+PriceScale*100 Then ExitLong("bx2",AtStop,EntryPrice+PriceScale*40); if HH >= EntryPrice+PriceScale*100 and HH < EntryPrice+PriceScale*200 Then ExitLong("bx3",AtStop,EntryPrice+PriceScale*60); } if MarketPosition == -1 Then{ LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*70 and LL > EntryPrice-PriceScale*80 Then Exitshort("sx1",AtStop,EntryPrice-PriceScale*20); if LL <= EntryPrice-PriceScale*80 and LL > EntryPrice-PriceScale*100 Then Exitshort("sx2",AtStop,EntryPrice-PriceScale*40); if LL <= EntryPrice-PriceScale*100 and LL > EntryPrice-PriceScale*200 Then Exitshort("sx3",AtStop,EntryPrice-PriceScale*60); } if MarketPosition == 1 then{ ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-03-28 11:45:27

안녕하세요 예스스탁입니다. 1. Input : shortPeriod(100), longPeriod(200); Input : 당일손실틱수(800),당일수익틱수(800); var : DH(0),DL(0); var : HH(0),LL(0),T1(0),entry(0); var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0); var : Xcond(false),N1(0); 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일손실틱수; value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) Then{ Condition1 = true; DH = H; DL = L; Xcond = false; N1 = NetProfit; } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if Condition1 == true then{ if H > DH Then DH = H; if L < DL Then DL = L; } if stime == 101500 or (stime > 101500 and stime[1] < 101500) Then { HH = H; LL = L; T1 = TotalTrades; } if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; if stime >= 104500 and stime < 113000 then{ if H > HH Then HH = H; if L < LL Then LL = L; if HH >= LL+PriceScale*10 and entry < 20 and Xcond == false then { if DL > 0 and C < DL+PriceScale*300 and crossup(value1,value2) Then buy(); if DH > 0 and C > DH-PriceScale*300 and CrossDown(value1,value2) Then sell(); } } SetStopLoss(PriceScale*30,PointStop); SetStopProfittarget(PriceScale*60,PointStop); if MarketPosition == 1 Then{ HH = highest(H,BarsSinceEntry); if HH >= EntryPrice+PriceScale*39 and HH < EntryPrice+PriceScale*44 Then ExitLong("수청0",AtStop,EntryPrice+PriceScale*0); if HH >= EntryPrice+PriceScale*50 and HH < EntryPrice+PriceScale*55 Then ExitLong("수청1",AtStop,EntryPrice+PriceScale*15); if HH >= EntryPrice+PriceScale*44 and HH < EntryPrice+PriceScale*50 Then ExitLong("수청2",AtStop,EntryPrice+PriceScale*7); if HH >= EntryPrice+PriceScale*55 and HH < EntryPrice+PriceScale*60 Then ExitLong("수청3",AtStop,EntryPrice+PriceScale*25); if HH >= EntryPrice+PriceScale*60 and HH < EntryPrice+PriceScale*70 Then ExitLong("수청4",AtStop,EntryPrice+PriceScale*40); if HH >= EntryPrice+PriceScale*70 and HH < EntryPrice+PriceScale*80 Then ExitLong("수청5",AtStop,EntryPrice+PriceScale*50); if HH >= EntryPrice+PriceScale*80 and HH < EntryPrice+PriceScale*90 Then ExitLong("수청6",AtStop,EntryPrice+PriceScale*60); if HH >= EntryPrice+PriceScale*90 and HH < EntryPrice+PriceScale*1200 Then ExitLong("수청7",AtStop,EntryPrice+PriceScale*70); } if MarketPosition == -1 Then{ LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*39 and LL > EntryPrice-PriceScale*44 Then Exitshort("도청0",AtStop,EntryPrice-PriceScale*0); LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*50 and LL > EntryPrice-PriceScale*55 Then Exitshort("도청1",AtStop,EntryPrice-PriceScale*15); LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*44 and LL > EntryPrice-PriceScale*50 Then Exitshort("도청2",AtStop,EntryPrice-PriceScale* 7); if LL <= EntryPrice-PriceScale*55 and LL > EntryPrice-PriceScale*90 Then Exitshort("도청3",AtStop,EntryPrice-PriceScale* 25); if LL <= EntryPrice-PriceScale*60 and LL > EntryPrice-PriceScale*70 Then Exitshort("도청4",AtStop,EntryPrice-PriceScale* 40); if LL <= EntryPrice-PriceScale*70 and LL > EntryPrice-PriceScale*80 Then Exitshort("도청5",AtStop,EntryPrice-PriceScale* 50); if LL <= EntryPrice-PriceScale*80 and LL > EntryPrice-PriceScale*90 Then Exitshort("도청6",AtStop,EntryPrice-PriceScale* 60); if LL <= EntryPrice-PriceScale*90 and LL > EntryPrice-PriceScale*1000 Then Exitshort("도청7",AtStop,EntryPrice-PriceScale* 70); } if MarketPosition == 10 then{ ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } 2 Inputs: Length(5), Consec(3); Input : 당일손실틱수(500),당일수익틱수(500); var : DH(0),DL(0); var : HH(0),LL(0),T1(0),entry(0); var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0); var : Xcond(false),N1(0); 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일손실틱수; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) Then{ Condition1 = true; DH = H; DL = L; Xcond = false; N1 = NetProfit; } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if Condition1 == true then{ if H > DH Then DH = H; if L < DL Then DL = L; } If Xcond == false and DL > 0 and C < DL+PriceScale*300 and stime > 104000 and stime < 115000 and CountIf(Close > Highest(High, Length)[1], Consec) == Consec Then Buy ("매수"); If Xcond == false and DH > 0 and C > DH-PriceScale*300 and stime > 104000 and stime < 115000 and CountIf(Close < Lowest(Low, Length)[1], Consec) == Consec Then Sell ("매도"); SetStopLoss(PriceScale*60,PointStop); SetStopProfittarget(PriceScale*110,PointStop); if MarketPosition == 1 Then{ HH = highest(H,BarsSinceEntry); if HH >= EntryPrice+PriceScale*70 and HH < EntryPrice+PriceScale*80 Then ExitLong("bx1",AtStop,EntryPrice+PriceScale*20); if HH >= EntryPrice+PriceScale*80 and HH < EntryPrice+PriceScale*100 Then ExitLong("bx2",AtStop,EntryPrice+PriceScale*40); if HH >= EntryPrice+PriceScale*100 and HH < EntryPrice+PriceScale*200 Then ExitLong("bx3",AtStop,EntryPrice+PriceScale*60); } if MarketPosition == -1 Then{ LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*70 and LL > EntryPrice-PriceScale*80 Then Exitshort("sx1",AtStop,EntryPrice-PriceScale*20); if LL <= EntryPrice-PriceScale*80 and LL > EntryPrice-PriceScale*100 Then Exitshort("sx2",AtStop,EntryPrice-PriceScale*40); if LL <= EntryPrice-PriceScale*100 and LL > EntryPrice-PriceScale*200 Then Exitshort("sx3",AtStop,EntryPrice-PriceScale*60); } if MarketPosition == 1 then{ ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } 즐거운 하루되세요 > 수원 님이 쓴 글입니다. > 제목 : 안녕하세세요 > 아래식에서 하루손절익절후 매매매정지식인데 계속 진입합니다 잘못된 부분 수정부탁합니다 첫번째식 Input : shortPeriod(100), longPeriod(200); Input : 당일손실틱수(800),당일수익틱수(800); value1 = ma(C, shortPeriod); value2 =ma(C, longPeriod); var : DH(0),DL(0); var : HH(0),LL(0),T1(0),entry(0); var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0); 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일손실틱수; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) Then{ Condition1 = true; DH = H; DL = L; } if Condition1 == true then{ if H > DH Then DH = H; if L < DL Then DL = L; } if stime == 101500 or (stime > 101500 and stime[1] < 101500) Then { HH = H; LL = L; T1 = TotalTrades; } if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; if stime >= 104500 and stime < 113000 then{ if H > HH Then HH = H; if L < LL Then LL = L; if HH >= LL+PriceScale*10 and entry < 20 then { if DL > 0 and C < DL+PriceScale*300 and crossup(value1,value2) Then buy(); if DH > 0 and C > DH-PriceScale*300 and CrossDown(value1,value2) Then sell(); } } SetStopLoss(PriceScale*30,PointStop); SetStopProfittarget(PriceScale*60,PointStop); if MarketPosition == 1 Then{ HH = highest(H,BarsSinceEntry); if HH >= EntryPrice+PriceScale*39 and HH < EntryPrice+PriceScale*44 Then ExitLong("수청0",AtStop,EntryPrice+PriceScale*0); if HH >= EntryPrice+PriceScale*50 and HH < EntryPrice+PriceScale*55 Then ExitLong("수청1",AtStop,EntryPrice+PriceScale*15); if HH >= EntryPrice+PriceScale*44 and HH < EntryPrice+PriceScale*50 Then ExitLong("수청2",AtStop,EntryPrice+PriceScale*7); if HH >= EntryPrice+PriceScale*55 and HH < EntryPrice+PriceScale*60 Then ExitLong("수청3",AtStop,EntryPrice+PriceScale*25); if HH >= EntryPrice+PriceScale*60 and HH < EntryPrice+PriceScale*70 Then ExitLong("수청4",AtStop,EntryPrice+PriceScale*40); if HH >= EntryPrice+PriceScale*70 and HH < EntryPrice+PriceScale*80 Then ExitLong("수청5",AtStop,EntryPrice+PriceScale*50); if HH >= EntryPrice+PriceScale*80 and HH < EntryPrice+PriceScale*90 Then ExitLong("수청6",AtStop,EntryPrice+PriceScale*60); if HH >= EntryPrice+PriceScale*90 and HH < EntryPrice+PriceScale*1200 Then ExitLong("수청7",AtStop,EntryPrice+PriceScale*70); } if MarketPosition == -1 Then{ LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*39 and LL > EntryPrice-PriceScale*44 Then Exitshort("도청0",AtStop,EntryPrice-PriceScale*0); LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*50 and LL > EntryPrice-PriceScale*55 Then Exitshort("도청1",AtStop,EntryPrice-PriceScale*15); LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*44 and LL > EntryPrice-PriceScale*50 Then Exitshort("도청2",AtStop,EntryPrice-PriceScale* 7); if LL <= EntryPrice-PriceScale*55 and LL > EntryPrice-PriceScale*90 Then Exitshort("도청3",AtStop,EntryPrice-PriceScale* 25); if LL <= EntryPrice-PriceScale*60 and LL > EntryPrice-PriceScale*70 Then Exitshort("도청4",AtStop,EntryPrice-PriceScale* 40); if LL <= EntryPrice-PriceScale*70 and LL > EntryPrice-PriceScale*80 Then Exitshort("도청5",AtStop,EntryPrice-PriceScale* 50); if LL <= EntryPrice-PriceScale*80 and LL > EntryPrice-PriceScale*90 Then Exitshort("도청6",AtStop,EntryPrice-PriceScale* 60); if LL <= EntryPrice-PriceScale*90 and LL > EntryPrice-PriceScale*1000 Then Exitshort("도청7",AtStop,EntryPrice-PriceScale* 70); } if MarketPosition == 10 then{ ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } 두번째식 Inputs: Length(5), Consec(3); Input : 당일손실틱수(500),당일수익틱수(500); var : DH(0),DL(0); var : HH(0),LL(0),T1(0),entry(0); var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0); 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일손실틱수; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) Then{ Condition1 = true; DH = H; DL = L; } if Condition1 == true then{ if H > DH Then DH = H; if L < DL Then DL = L; } If DL > 0 and C < DL+PriceScale*300 and stime > 104000 and stime < 115000 and CountIf(Close > Highest(High, Length)[1], Consec) == Consec Then Buy ("매수"); If DH > 0 and C > DH-PriceScale*300 and stime > 104000 and stime < 115000 and CountIf(Close < Lowest(Low, Length)[1], Consec) == Consec Then Sell ("매도"); SetStopLoss(PriceScale*60,PointStop); SetStopProfittarget(PriceScale*110,PointStop); if MarketPosition == 1 Then{ HH = highest(H,BarsSinceEntry); if HH >= EntryPrice+PriceScale*70 and HH < EntryPrice+PriceScale*80 Then ExitLong("bx1",AtStop,EntryPrice+PriceScale*20); if HH >= EntryPrice+PriceScale*80 and HH < EntryPrice+PriceScale*100 Then ExitLong("bx2",AtStop,EntryPrice+PriceScale*40); if HH >= EntryPrice+PriceScale*100 and HH < EntryPrice+PriceScale*200 Then ExitLong("bx3",AtStop,EntryPrice+PriceScale*60); } if MarketPosition == -1 Then{ LL = lowest(L,BarsSinceEntry); if LL <= EntryPrice-PriceScale*70 and LL > EntryPrice-PriceScale*80 Then Exitshort("sx1",AtStop,EntryPrice-PriceScale*20); if LL <= EntryPrice-PriceScale*80 and LL > EntryPrice-PriceScale*100 Then Exitshort("sx2",AtStop,EntryPrice-PriceScale*40); if LL <= EntryPrice-PriceScale*100 and LL > EntryPrice-PriceScale*200 Then Exitshort("sx3",AtStop,EntryPrice-PriceScale*60); } if MarketPosition == 1 then{ ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); }