커뮤니티
수식문의
2019-08-01 08:11:34
234
글번호 130827
당일 시가를 기준으로
1. 매수
+0.5p 마다 매수. 최대수량 3계약.
0.5 1.0 1.5 매수가 되겠네요.
한계약이라도 진입이 되면 최고가 대비 -0.3p일때 전량 청산.
청산된 가격부터 다시 위와 동일하게 0.5p마다 진입.
2. 매도
1번과 반대로 동일하게 -0.5p마다 매도
3. +0.5대신 +0.3%로 변경.
번거로우시겠지만 부탁드립니다.
감사합니다.
답변 1
예스스탁 예스스탁 답변
2019-08-01 14:31:52
안녕하세요
예스스탁입니다.
시스템 트레이딩 설정창의 피라미딩탭에서
피라미딩을 모든진입신호 허용으로 설정하고 적용하시면 됩니다.
1
input : pt(0.5),xpt(0.3);
if MarketPosition == 0 and ExitDate(1) != sdate and NextBarSdate == sdate Then
buy("b1",AtStop,dayopen(0)+pt);
if MarketPosition == 0 and ExitDate(1) == sdate and NextBarSdate == sdate Then
buy("b2",AtStop,ExitPrice(1)+pt);
if MarketPosition == 0 and ExitDate(1) != sdate and NextBarSdate == sdate Then
sell("s1",AtStop,dayopen(0)-pt);
if MarketPosition == 0 and ExitDate(1) == sdate and NextBarSdate == sdate Then
sell("s2",AtStop,ExitPrice(1)-pt);
if MarketPosition == 1 and NextBarSdate == sdate Then
{
buy("bb",AtStop,LatestEntryPrice(0)+pt);
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-0.3);
}
if MarketPosition == -1 and NextBarSdate == sdate Then
{
sell("ss",AtStop,LatestEntryPrice(0)-pt);
ExitShort("sx",AtStop,Lowest(L,BarsSinceEntry)+0.3);
}
2
input : per(0.5),xper(0.3);
if MarketPosition == 0 and ExitDate(1) != sdate and NextBarSdate == sdate Then
buy("b1",AtStop,dayopen(0)*(1+per/100));
if MarketPosition == 0 and ExitDate(1) == sdate and NextBarSdate == sdate Then
buy("b2",AtStop,ExitPrice(1)*(1+per/100));
if MarketPosition == 0 and ExitDate(1) != sdate and NextBarSdate == sdate Then
sell("s1",AtStop,dayopen(0)*(1-per/100));
if MarketPosition == 0 and ExitDate(1) == sdate and NextBarSdate == sdate Then
sell("s2",AtStop,ExitPrice(1)*(1-per/100));
if MarketPosition == 1 and NextBarSdate == sdate Then
{
buy("bb",AtStop,LatestEntryPrice(0)*(1+per/100));
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)*(1+xper/100));
}
if MarketPosition == -1 and NextBarSdate == sdate Then
{
sell("ss",AtStop,LatestEntryPrice(0)*(1-per/100));
ExitShort("sx",AtStop,Lowest(L,BarsSinceEntry)*(1-xper/100));
}
즐거운 하루되세요
> 무사시 님이 쓴 글입니다.
> 제목 : 수식문의
> 당일 시가를 기준으로
1. 매수
+0.5p 마다 매수. 최대수량 3계약.
0.5 1.0 1.5 매수가 되겠네요.
한계약이라도 진입이 되면 최고가 대비 -0.3p일때 전량 청산.
청산된 가격부터 다시 위와 동일하게 0.5p마다 진입.
2. 매도
1번과 반대로 동일하게 -0.5p마다 매도
3. +0.5대신 +0.3%로 변경.
번거로우시겠지만 부탁드립니다.
감사합니다.
다음글
이전글