커뮤니티

복리투자건너띄기에서한도정하기

프로필 이미지
큰바위얼굴
2016-02-03 13:39:15
90
글번호 95136
답변완료
Input : shortPeriod(5), longPeriod(20) ; Var : value(0),vol(0),cnt(0); if TotalTrades > TotalTrades[1] Then{ if PositionProfit(1) < 0 Then cnt = cnt+1; Else cnt = 0; MessageLog("%.f",cnt); } if MarketPosition == 0 Then{ if PositionProfit(1) < 0 and cnt >= 3 Then vol = 1*2^int(cnt/3); Else vol = 1; } if MarketPosition != 0 Then{ if PositionProfit < 0 and cnt+1 >= 3 Then vol = 1*2^int((cnt+1)/3); 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); 위수식에서 복리한도 6번 이상 안되게하고 수익이 직전고가 갈대까지 마지막제일큰계약으로 매매됨니다 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-02-03 13:16:51

안녕하세요 예스스탁입니다. Input : shortPeriod(5), longPeriod(20) ; Var : value(0),vol(0),cnt(0); if TotalTrades > TotalTrades[1] Then{ if PositionProfit(1) < 0 Then cnt = cnt+1; Else cnt = 0; MessageLog("%.f",cnt); } if MarketPosition == 0 Then{ if PositionProfit(1) < 0 and cnt >= 3 Then vol = 1*2^min(6,int(cnt/3)); Else vol = 1; } if MarketPosition != 0 Then{ if PositionProfit < 0 and cnt+1 >= 3 Then vol = 1*2^min(6,int((cnt+1)/3)); 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),cnt(0); if TotalTrades > TotalTrades[1] Then{ if PositionProfit(1) < 0 Then cnt = cnt+1; Else cnt = 0; MessageLog("%.f",cnt); } if MarketPosition == 0 Then{ if PositionProfit(1) < 0 and cnt >= 3 Then vol = 1*2^int(cnt/3); Else vol = 1; } if MarketPosition != 0 Then{ if PositionProfit < 0 and cnt+1 >= 3 Then vol = 1*2^int((cnt+1)/3); 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); 위수식에서 복리한도 6번 이상 안되게하고 수익이 직전고가 갈대까지 마지막제일큰계약으로 매매됨니다 감사합니다.