커뮤니티
부탁드립니다===
2011-02-16 22:32:22
738
글번호 35809
Input : Period(5),maP(20),N(0.7),Tr1(0.1),Tr2(0.2진입(10000),스탑(5);
Var : value(0);
value = ma(bids,period)-ma(asks,period);
if stime >= 110000 and stime < 145900 then{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N Then
Sell();
SetStopLoss(PriceScale*스탑,PointStop);
#SetStopProfittarget(PriceScale*17,PointStop);
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-Tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-Tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+Tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+Tr2);
}
}
수고많으십니다
위와같이 매매하니 매수(매도)후 반대포지션으로 진입할때 증거금부족이 생기네요
그러므로 반대포지션진입시 1계약청산하고 바로 1계약 진입하게 해주세요,감사합니다
그리고 15:01에는 모든포지션 을 청산하게해주세요 부탁드립니다
답변 1
예스스탁 예스스탁 답변
2011-02-17 09:47:55
안녕하세요
예스스탁입니다.
해당 내용은 수식으로는 처리가 되지 않습니다.
수식은 잔고와 연동이 되지 않아 청산주문이 체결여부를 알수가 없습니다.
문의하신 내용에 대한 보완기능으로
시스템 트레이딩 설정창의 부가기능 중 진입지연주문기능에 제공되고 있습니다.
진입주문지연은 작성하신 내용과 같이 청산과 진입이 동시 발생할 때
청산주문은 바로 주문하고 진입주문은 지정한 초시간 이후에 주문하게 됩니다.
현재로서는 해당기능을 이용하시는 방법외에는 없습니다.
아래는 당일 청산을 추가한 식입니다.
Input : Period(5),maP(20),N(0.7),Tr1(0.1),Tr2(0.2),진입(10000),스탑(5);
Var : value(0);
value = ma(bids,period)-ma(asks,period);
if stime >= 110000 and stime < 145900 then{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N Then
Sell();
SetStopLoss(PriceScale*스탑,PointStop);
#SetStopProfittarget(PriceScale*17,PointStop);
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-Tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-Tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+Tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+Tr2);
}
}
SetStopEndofday(150100);
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 부탁드립니다===
> Input : Period(5),maP(20),N(0.7),Tr1(0.1),Tr2(0.2진입(10000),스탑(5);
Var : value(0);
value = ma(bids,period)-ma(asks,period);
if stime >= 110000 and stime < 145900 then{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N Then
Sell();
SetStopLoss(PriceScale*스탑,PointStop);
#SetStopProfittarget(PriceScale*17,PointStop);
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-Tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-Tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+Tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+Tr2);
}
}
수고많으십니다
위와같이 매매하니 매수(매도)후 반대포지션으로 진입할때 증거금부족이 생기네요
그러므로 반대포지션진입시 1계약청산하고 바로 1계약 진입하게 해주세요,감사합니다
그리고 15:01에는 모든포지션 을 청산하게해주세요 부탁드립니다