커뮤니티
5번손실후1개더투자하기
2016-02-18 18:57:35
106
글번호 95525
Input : shortPeriod(2), longPeriod(20) ;
Var : value(0),vol(0);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol = MaxContracts+1;
Else
vol = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol = MaxContracts(1)+1;
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(3.1), AtrPeriod(3);
var : AtrVal(0), posHigh(0), posLow(0),vol2(0);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol2 = MaxContracts+1;
Else
vol2 = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol2 = MaxContracts(1)+1;
Else
vol2 = 1;
}
# ATR 추적청산
ATRVal = ATR(AtrPeriod) * AtrMult;
PosHigh = Highest(H,BarssinceEntry+2);
PosLow = Lowest(L,BarsSinceEntry+2);
위수식에서 손실5번 날때마다 1개더 투자부탁합니다
목표가후복귀
항상감사합니다
답변 1
예스스탁 예스스탁 답변
2016-02-19 09:51:01
안녕하세요
예스스탁입니다.
이전에 비슷한 내용에 대해 문의하신 적이 있습니다.
해당수식에서 횟수만 다른 내용입니다.
수식답변은 사용자분이 직접코딩하신다는 전제하에
도움을 드리는 부분입니다.
답변드린 수식 내용에 대해 숙지하시기 바랍니다.
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;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 and cnt >= 5 Then
vol = min(80,1*2^int(cnt/5));
Else
vol = 1;
}
if MarketPosition != 0 Then{
if PositionProfit < 0 and cnt+1 >= 5 Then
vol = min(80,1*2^int((cnt+1)/5));
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);
즐거운 하루되세요
> 큰바위얼굴 님이 쓴 글입니다.
> 제목 : 5번손실후1개더투자하기
> Input : shortPeriod(2), longPeriod(20) ;
Var : value(0),vol(0);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol = MaxContracts+1;
Else
vol = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol = MaxContracts(1)+1;
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(3.1), AtrPeriod(3);
var : AtrVal(0), posHigh(0), posLow(0),vol2(0);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol2 = MaxContracts+1;
Else
vol2 = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol2 = MaxContracts(1)+1;
Else
vol2 = 1;
}
# ATR 추적청산
ATRVal = ATR(AtrPeriod) * AtrMult;
PosHigh = Highest(H,BarssinceEntry+2);
PosLow = Lowest(L,BarsSinceEntry+2);
위수식에서 손실5번 날때마다 1개더 투자부탁합니다
목표가후복귀
항상감사합니다