커뮤니티

수식문의 드립니다.

프로필 이미지
softtoug
2017-02-01 23:11:15
98
글번호 106448
답변완료
안녕하세요 하기 수식 수정 부탁드립니다. Input : Period(20), MultiD(2); var : MAv(0),BBup(0),BBdn(0),T(0); MAv = ma(C,Period); BBup = BollBandUp(Period,MultiD); BBdn = BollBandDown(Period,MultiD); if T <= 0 and C > BBup and C > O Then{ T = 1; buy("b"); } if T >= 0 and C < BBdn and C < O Then{ T = -1; sell("s"); } #매수추세이고 무포지션이고 직전 청산가격을 상향돌파하면 재매수 if T == 1 and MarketPosition == 0 and crossup(c,ExitPrice(1)) Then buy("bb"); #매도추세이고 무포지션이고 직전 청산가격을 하향이탈하면 재매도 if T == -1 and MarketPosition == 0 and CrossDown(c,ExitPrice(1)) Then sell("ss"); 1. 가격변동이 심하여 하기 부분을 보정 부탁드립니다. 상기 수식에서 bb 또는 ss로 재매수/재매도 들어갈 때, 수정할 부분이 좀 있습니다. 매수 bb 진입시 볼린져 밴드 이평 아래에서 진입이 발생할 경우 매도로 들어가는 옵션부탁드립니다. 매도 ss 진입시도 마찬가지로 볼린져 밴드 이평 위에서 진입이 발생할 경우 매수로 들어가는 옵션 부탁드립니다. 추가로 아예 bb 진입을 해야 하는데, 볼린져 이평 아래에서 들어가야 한다면 신호를 발생시키지 않는 수식도 부탁드립니다. ss도 마찬가지 입니다. input : P(14),BBP(20),dv(2),MAP(60); input : short(12),long(26),sig(9); var : ADXV(0),DP(0),DM(0),T(0),BBup(0),BBdn(0),mav(0); var : MACDV(0),MACDS(0),Bcond(false),Scond(False),bbmd(0),diff(0),cnt(0),count(0); ADXV = ADX(P); DP = Diplus(P); DM = DiMinus(P); bbmd = ma(c,BBP); BBup = BollBandUp(BBP,dv); BBdn = BollBandDown(BBP,dv); mav = ma(C,MAP); MACDV = MACD(short,long); MACDS = ema(MACDV,sig); diff = C-O; Bcond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 2) or (MarketPosition == -1 and BarsSinceEntry >= 2); Scond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 2) or (MarketPosition == 1 and BarsSinceEntry >= 2); if CrossUp(BBdn,mav) and countif(crossdown(BBdn,mav),1) < 1 and DP < 40 and bcond == true Then buy("b1"); if CrossDown(BBup,mav) and countif(CrossUp(BBup,mav),1) < 1 and DM <40 and scond == true Then sell("s1"); if MarketPosition == 0 Then{ if MarketPosition(1) == 1 and IsExitName("StopTrailing",1) == true and H > BBdn and macdv > macds then { buy("bb",AtStop,C-PriceScale); } if MarketPosition(1) == -1 and IsExitName("StopTrailing",1) == true and L < BBup and macdv < macds then { sell("ss",AtStop,C+PriceScale); } 2. 상기 수식의 bb와 ss도 1번과 같은 가격옵션 부탁드립니다. a. bb 신호가 발생하여 매수 진입시 볼린져 이평 하단에 있으면 매도로 진입, ss 신호가 발생하여 매도 진입시 볼린져 이평 상단에 있으면 매수로 진입, b. bb 신호가 발생하여 매수 진입시 볼린져 이평 하단에 있으면 신호 취소. ss 신호가 발생하여 매도 진입시 볼린져 이평 상단에 있으면 신호 취소. 3. 볼린져 밴드의 상단과 하단의 폭이 50틱 이내에서는 상기의 bb/ss 의 어떠한 신호도 발생하지 않는 수식을 만들 수 있으신지 확인 부탁드립니다. 작아지기 전에 진입한 신호는 예정대로 손절 또는 익절을 진행합니다. 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-02-02 12:53:59

안녕하세요 예스스탁입니다. 1-1 Input : Period(20), MultiD(2); var : MAv(0),BBup(0),BBdn(0),T(0); MAv = ma(C,Period); BBup = BollBandUp(Period,MultiD); BBdn = BollBandDown(Period,MultiD); if T <= 0 and C > BBup and C > O Then{ T = 1; buy("b"); } if T >= 0 and C < BBdn and C < O Then{ T = -1; sell("s"); } #매수추세이고 무포지션이고 직전 청산가격을 상향돌파하면 재매수 if T == 1 and MarketPosition == 0 and crossup(c,ExitPrice(1)) and BBup-BBdn >= PriceScale*50 Then{ if C > MAv Then buy("bb"); else sell("bs"); } #매도추세이고 무포지션이고 직전 청산가격을 하향이탈하면 재매도 if T == -1 and MarketPosition == 0 and CrossDown(c,ExitPrice(1)) and BBup-BBdn >= PriceScale*50 Then{ if C < MAv Then sell("ss"); Else buy("sb"); } 1-2 Input : Period(20), MultiD(2); var : MAv(0),BBup(0),BBdn(0),T(0); MAv = ma(C,Period); BBup = BollBandUp(Period,MultiD); BBdn = BollBandDown(Period,MultiD); if T <= 0 and C > BBup and C > O Then{ T = 1; buy("b"); } if T >= 0 and C < BBdn and C < O Then{ T = -1; sell("s"); } #매수추세이고 무포지션이고 직전 청산가격을 상향돌파하면 재매수 if T == 1 and MarketPosition == 0 and crossup(c,ExitPrice(1)) and BBup-BBdn >= PriceScale*50 Then{ if C > MAv Then buy("bb"); } #매도추세이고 무포지션이고 직전 청산가격을 하향이탈하면 재매도 if T == -1 and MarketPosition == 0 and CrossDown(c,ExitPrice(1)) and BBup-BBdn >= PriceScale*50 Then{ if C < MAv Then sell("ss"); } 2-1 input : P(14),BBP(20),dv(2),MAP(60); input : short(12),long(26),sig(9); var : ADXV(0),DP(0),DM(0),T(0),BBup(0),BBdn(0),mav(0); var : MACDV(0),MACDS(0),Bcond(false),Scond(False),bbmd(0),diff(0),cnt(0),count(0); ADXV = ADX(P); DP = Diplus(P); DM = DiMinus(P); bbmd = ma(c,BBP); BBup = BollBandUp(BBP,dv); BBdn = BollBandDown(BBP,dv); mav = ma(C,MAP); MACDV = MACD(short,long); MACDS = ema(MACDV,sig); diff = C-O; Bcond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 2) or (MarketPosition == -1 and BarsSinceEntry >= 2); Scond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 2) or (MarketPosition == 1 and BarsSinceEntry >= 2); if CrossUp(BBdn,mav) and countif(crossdown(BBdn,mav),1) < 1 and DP < 40 and bcond == true Then buy("b1"); if CrossDown(BBup,mav) and countif(CrossUp(BBup,mav),1) < 1 and DM <40 and scond == true Then sell("s1"); if MarketPosition == 0 and BBup-BBdn >= PriceScale*50 Then{ if MarketPosition(1) == 1 and IsExitName("StopTrailing",1) == true and H > BBdn and macdv > macds then { if C > BBmd Then buy("bb",AtStop,C-PriceScale); Else sell("bs"); } if MarketPosition(1) == -1 and IsExitName("StopTrailing",1) == true and L < BBup and macdv < macds then { if C < BBmd Then sell("ss",AtStop,C+PriceScale); Else buy("sb"); } 2-2 input : P(14),BBP(20),dv(2),MAP(60); input : short(12),long(26),sig(9); var : ADXV(0),DP(0),DM(0),T(0),BBup(0),BBdn(0),mav(0); var : MACDV(0),MACDS(0),Bcond(false),Scond(False),bbmd(0),diff(0),cnt(0),count(0); ADXV = ADX(P); DP = Diplus(P); DM = DiMinus(P); bbmd = ma(c,BBP); BBup = BollBandUp(BBP,dv); BBdn = BollBandDown(BBP,dv); mav = ma(C,MAP); MACDV = MACD(short,long); MACDS = ema(MACDV,sig); diff = C-O; Bcond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 2) or (MarketPosition == -1 and BarsSinceEntry >= 2); Scond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 2) or (MarketPosition == 1 and BarsSinceEntry >= 2); if CrossUp(BBdn,mav) and countif(crossdown(BBdn,mav),1) < 1 and DP < 40 and bcond == true Then buy("b1"); if CrossDown(BBup,mav) and countif(CrossUp(BBup,mav),1) < 1 and DM <40 and scond == true Then sell("s1"); if MarketPosition == 0 and BBup-BBdn >= PriceScale*50 Then{ if MarketPosition(1) == 1 and IsExitName("StopTrailing",1) == true and H > BBdn and macdv > macds then { if C > BBmd Then buy("bb",AtStop,C-PriceScale); } if MarketPosition(1) == -1 and IsExitName("StopTrailing",1) == true and L < BBup and macdv < macds then { if C < BBmd Then sell("ss",AtStop,C+PriceScale); } 즐거운 하루되세요 > softtoug 님이 쓴 글입니다. > 제목 : 수식문의 드립니다. > 안녕하세요 하기 수식 수정 부탁드립니다. Input : Period(20), MultiD(2); var : MAv(0),BBup(0),BBdn(0),T(0); MAv = ma(C,Period); BBup = BollBandUp(Period,MultiD); BBdn = BollBandDown(Period,MultiD); if T <= 0 and C > BBup and C > O Then{ T = 1; buy("b"); } if T >= 0 and C < BBdn and C < O Then{ T = -1; sell("s"); } #매수추세이고 무포지션이고 직전 청산가격을 상향돌파하면 재매수 if T == 1 and MarketPosition == 0 and crossup(c,ExitPrice(1)) Then buy("bb"); #매도추세이고 무포지션이고 직전 청산가격을 하향이탈하면 재매도 if T == -1 and MarketPosition == 0 and CrossDown(c,ExitPrice(1)) Then sell("ss"); 1. 가격변동이 심하여 하기 부분을 보정 부탁드립니다. 상기 수식에서 bb 또는 ss로 재매수/재매도 들어갈 때, 수정할 부분이 좀 있습니다. 매수 bb 진입시 볼린져 밴드 이평 아래에서 진입이 발생할 경우 매도로 들어가는 옵션부탁드립니다. 매도 ss 진입시도 마찬가지로 볼린져 밴드 이평 위에서 진입이 발생할 경우 매수로 들어가는 옵션 부탁드립니다. 추가로 아예 bb 진입을 해야 하는데, 볼린져 이평 아래에서 들어가야 한다면 신호를 발생시키지 않는 수식도 부탁드립니다. ss도 마찬가지 입니다. input : P(14),BBP(20),dv(2),MAP(60); input : short(12),long(26),sig(9); var : ADXV(0),DP(0),DM(0),T(0),BBup(0),BBdn(0),mav(0); var : MACDV(0),MACDS(0),Bcond(false),Scond(False),bbmd(0),diff(0),cnt(0),count(0); ADXV = ADX(P); DP = Diplus(P); DM = DiMinus(P); bbmd = ma(c,BBP); BBup = BollBandUp(BBP,dv); BBdn = BollBandDown(BBP,dv); mav = ma(C,MAP); MACDV = MACD(short,long); MACDS = ema(MACDV,sig); diff = C-O; Bcond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 2) or (MarketPosition == -1 and BarsSinceEntry >= 2); Scond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 2) or (MarketPosition == 1 and BarsSinceEntry >= 2); if CrossUp(BBdn,mav) and countif(crossdown(BBdn,mav),1) < 1 and DP < 40 and bcond == true Then buy("b1"); if CrossDown(BBup,mav) and countif(CrossUp(BBup,mav),1) < 1 and DM <40 and scond == true Then sell("s1"); if MarketPosition == 0 Then{ if MarketPosition(1) == 1 and IsExitName("StopTrailing",1) == true and H > BBdn and macdv > macds then { buy("bb",AtStop,C-PriceScale); } if MarketPosition(1) == -1 and IsExitName("StopTrailing",1) == true and L < BBup and macdv < macds then { sell("ss",AtStop,C+PriceScale); } 2. 상기 수식의 bb와 ss도 1번과 같은 가격옵션 부탁드립니다. a. bb 신호가 발생하여 매수 진입시 볼린져 이평 하단에 있으면 매도로 진입, ss 신호가 발생하여 매도 진입시 볼린져 이평 상단에 있으면 매수로 진입, b. bb 신호가 발생하여 매수 진입시 볼린져 이평 하단에 있으면 신호 취소. ss 신호가 발생하여 매도 진입시 볼린져 이평 상단에 있으면 신호 취소. 3. 볼린져 밴드의 상단과 하단의 폭이 50틱 이내에서는 상기의 bb/ss 의 어떠한 신호도 발생하지 않는 수식을 만들 수 있으신지 확인 부탁드립니다. 작아지기 전에 진입한 신호는 예정대로 손절 또는 익절을 진행합니다. 감사합니다.