커뮤니티
수식요청드립니다.
2016-02-26 09:18:39
91
글번호 95812
안녕하세요.
오버형 시스템에 피라미딩진입, 손절청산수식을 추가할경우 피라미딩 누적진입 총합계 손실로
당일손절 추세손절 될수있도록 수식수정 요청드립니다.
(아래수식 적용시 개별진입별로 당일손절 추세손절 청산되네요. 수식 수정이 잘안되네요)
감사합니다.
#피라미딩
input : i증감(0.5),누적진입횟수(3);
if MarketPosition == 1 Then{
if MaxEntries < 누적진입횟수 Then
buy("B",AtStop,LatestEntryPrice(0)+i증감);
}
if MarketPosition == -1 Then{
if MaxEntries < 누적진입횟수 Then
sell("S",AtStop,LatestEntryPrice(0)-i증감);
}
# 당일손절 추세손절
Input : OPT1(5.0),DPT1(3.5);
if MarketPosition == 1 Then{
if EntryDate < sdate Then
ExitLong("추세손절BX1",AtStop,EntryPrice-OPT1);
Else
ExitLong("당일손절BX2",AtStop,EntryPrice-DPT1);
}
if MarketPosition == -1 Then{
if EntryDate < sdate Then
ExitShort("추세손절SX1",AtStop,EntryPrice+OPT1);
Else
ExitShort("당일손절SX2",AtStop,EntryPrice+DPT1);
}
답변 1
예스스탁 예스스탁 답변
2016-02-26 15:25:21
안녕하세요
예스스탁입니다.
수익, 손절 포인트 값을 현재 보유수량을 나누어서 진입가에 가감하시면 됩니다.
input : i증감(0.5),누적진입횟수(3);
if MarketPosition == 1 Then{
if MaxEntries < 누적진입횟수 Then
buy("B",AtStop,LatestEntryPrice(0)+i증감);
}
if MarketPosition == -1 Then{
if MaxEntries < 누적진입횟수 Then
sell("S",AtStop,LatestEntryPrice(0)-i증감);
}
# 당일손절 추세손절
Input : OPT1(5.0),DPT1(3.5);
if MarketPosition == 1 Then{
if EntryDate < sdate Then
ExitLong("추세손절BX1",AtStop,EntryPrice-(OPT1/CurrentContracts));
Else
ExitLong("당일손절BX2",AtStop,EntryPrice-(DPT1/CurrentContracts));
}
if MarketPosition == -1 Then{
if EntryDate < sdate Then
ExitShort("추세손절SX1",AtStop,EntryPrice+(OPT1/CurrentContracts));
Else
ExitShort("당일손절SX2",AtStop,EntryPrice+(DPT1/CurrentContracts));
}
즐거운 하루되세요
> dandy 님이 쓴 글입니다.
> 제목 : 수식요청드립니다.
> 안녕하세요.
오버형 시스템에 피라미딩진입, 손절청산수식을 추가할경우 피라미딩 누적진입 총합계 손실로
당일손절 추세손절 될수있도록 수식수정 요청드립니다.
(아래수식 적용시 개별진입별로 당일손절 추세손절 청산되네요. 수식 수정이 잘안되네요)
감사합니다.
#피라미딩
input : i증감(0.5),누적진입횟수(3);
if MarketPosition == 1 Then{
if MaxEntries < 누적진입횟수 Then
buy("B",AtStop,LatestEntryPrice(0)+i증감);
}
if MarketPosition == -1 Then{
if MaxEntries < 누적진입횟수 Then
sell("S",AtStop,LatestEntryPrice(0)-i증감);
}
# 당일손절 추세손절
Input : OPT1(5.0),DPT1(3.5);
if MarketPosition == 1 Then{
if EntryDate < sdate Then
ExitLong("추세손절BX1",AtStop,EntryPrice-OPT1);
Else
ExitLong("당일손절BX2",AtStop,EntryPrice-DPT1);
}
if MarketPosition == -1 Then{
if EntryDate < sdate Then
ExitShort("추세손절SX1",AtStop,EntryPrice+OPT1);
Else
ExitShort("당일손절SX2",AtStop,EntryPrice+DPT1);
}
다음글
이전글