커뮤니티
부탁드립니다.
2018-02-28 17:13:54
186
글번호 117049
일봉매매를 할 때
최근 3번의 손익을 Array로 저장하고
3번모두 연속해서 손실이면 진입계약수를 3으로,
마지막 2번만 연속해서 손실이면 진입계약수를 2로,
그외는 진입계약수를 1로 설정하려면 시스템식을 어떻게 해야 하는지요.
손익계산은 수수료를 3틱으로 잡고 계산합니다.
If 매수조건 Then{
Buy("b",onclose,def,vol);
}
If 매도조건 Then{
Sell("s",onclose,def,vol);
}
부탁드립니다.
답변 1
예스스탁 예스스탁 답변
2018-03-02 08:42:31
안녕하세요
예스스탁입니다.
var : cnt(0),vol(0);
vol = 1;
if MarketPosition == 0 then{
if PositionProfit(1) < 0 and PositionProfit(2) < 0 Then
vol = 2;
if PositionProfit(1) < 0 and PositionProfit(2) < 0 and PositionProfit(3) < 0 Then
vol = 3;
}
if MarketPosition != 0 then{
if PositionProfit(0) < 0 and PositionProfit(1) < 0 Then
vol = 2;
if PositionProfit(0) < 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then
vol = 3;
}
If 매수조건 Then{
Buy("b",onclose,def,vol);
}
If 매도조건 Then{
Sell("s",onclose,def,vol);
}
즐거운 하루되세요
> 묘선낭자 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 일봉매매를 할 때
최근 3번의 손익을 Array로 저장하고
3번모두 연속해서 손실이면 진입계약수를 3으로,
마지막 2번만 연속해서 손실이면 진입계약수를 2로,
그외는 진입계약수를 1로 설정하려면 시스템식을 어떻게 해야 하는지요.
손익계산은 수수료를 3틱으로 잡고 계산합니다.
If 매수조건 Then{
Buy("b",onclose,def,vol);
}
If 매도조건 Then{
Sell("s",onclose,def,vol);
}
부탁드립니다.