커뮤니티

복리투자와한도정하기

프로필 이미지
큰바위얼굴
2016-02-04 10:50:38
88
글번호 95167
답변완료
Input : shortPeriod(5), longPeriod(20) ; Var : value(0),vol(0); if MarketPosition != 0 Then{ if PositionProfit < 0 Then Vol = MaxContracts*2; Else vol = 1; } if MarketPosition == 0 Then{ if PositionProfit(1) < 0 Then Vol = MaxContracts(1)*2; Else vol = 1; } value = OSCP(shortPeriod, longPeriod); If CrossUP(value, 0) Then Buy("b",OnClose,def,vol); If CrossDown(value,-0) Then Sell("s",OnClose,def,vol); # 추적청산 input : AtrMult(6), AtrPeriod(6); var : AtrVal(0), posHigh(0), posLow(0); # ATR 추적청산 ATRVal = ATR(AtrPeriod) * AtrMult; PosHigh = Highest(H,BarssinceEntry+2); PosLow = Lowest(L,BarsSinceEntry+2); If MarketPosition == 1 and C < ma(c,20) Then sell("ATR1", AtStop, PosHigh - ATRVal,Vol); If MarketPosition == -1 and C > ma(c,20) Then buy("ATR2", AtStop, PosLow + ATRVal,Vol); If MarketPosition == 0 and C > ma(C,20) Then sell("ATR3", AtStop, Highest(H,BarsSinceExit(1)+1) - ATRVal,Vol); If MarketPosition == 0 and C < ma(C,20) Then buy("ATR4", AtStop, Lowest(L,BarsSinceExit(1)+1) + ATRVal,Vol); 위수식에서 복리투자시한도를최대 80개로 해주세요 그후목표가후 원위치는 위와같습니다. 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-02-04 14:20:18

안녕하세요 예스스탁입니다. Input : shortPeriod(5), longPeriod(20) ; Var : value(0),vol(0); if MarketPosition != 0 Then{ if PositionProfit < 0 Then Vol = min(80,MaxContracts*2); Else vol = 1; } if MarketPosition == 0 Then{ if PositionProfit(1) < 0 Then Vol = min(80,MaxContracts(1)*2); Else vol = 1; } value = OSCP(shortPeriod, longPeriod); If CrossUP(value, 0) Then Buy("b",OnClose,def,vol); If CrossDown(value,-0) Then Sell("s",OnClose,def,vol); # 추적청산 input : AtrMult(6), AtrPeriod(6); var : AtrVal(0), posHigh(0), posLow(0); # ATR 추적청산 ATRVal = ATR(AtrPeriod) * AtrMult; PosHigh = Highest(H,BarssinceEntry+2); PosLow = Lowest(L,BarsSinceEntry+2); If MarketPosition == 1 and C < ma(c,20) Then sell("ATR1", AtStop, PosHigh - ATRVal,Vol); If MarketPosition == -1 and C > ma(c,20) Then buy("ATR2", AtStop, PosLow + ATRVal,Vol); If MarketPosition == 0 and C > ma(C,20) Then sell("ATR3", AtStop, Highest(H,BarsSinceExit(1)+1) - ATRVal,Vol); If MarketPosition == 0 and C < ma(C,20) Then buy("ATR4", AtStop, Lowest(L,BarsSinceExit(1)+1) + ATRVal,Vol); 즐거운 하루되세요 > 큰바위얼굴 님이 쓴 글입니다. > 제목 : 복리투자와한도정하기 > Input : shortPeriod(5), longPeriod(20) ; Var : value(0),vol(0); if MarketPosition != 0 Then{ if PositionProfit < 0 Then Vol = MaxContracts*2; Else vol = 1; } if MarketPosition == 0 Then{ if PositionProfit(1) < 0 Then Vol = MaxContracts(1)*2; Else vol = 1; } value = OSCP(shortPeriod, longPeriod); If CrossUP(value, 0) Then Buy("b",OnClose,def,vol); If CrossDown(value,-0) Then Sell("s",OnClose,def,vol); # 추적청산 input : AtrMult(6), AtrPeriod(6); var : AtrVal(0), posHigh(0), posLow(0); # ATR 추적청산 ATRVal = ATR(AtrPeriod) * AtrMult; PosHigh = Highest(H,BarssinceEntry+2); PosLow = Lowest(L,BarsSinceEntry+2); If MarketPosition == 1 and C < ma(c,20) Then sell("ATR1", AtStop, PosHigh - ATRVal,Vol); If MarketPosition == -1 and C > ma(c,20) Then buy("ATR2", AtStop, PosLow + ATRVal,Vol); If MarketPosition == 0 and C > ma(C,20) Then sell("ATR3", AtStop, Highest(H,BarsSinceExit(1)+1) - ATRVal,Vol); If MarketPosition == 0 and C < ma(C,20) Then buy("ATR4", AtStop, Lowest(L,BarsSinceExit(1)+1) + ATRVal,Vol); 위수식에서 복리투자시한도를최대 80개로 해주세요 그후목표가후 원위치는 위와같습니다. 감사합니다.