답변완료
추가 문의드립니다.
안녕하세요
아래와 같이 알려주셨는데요 여기에 혹시 추가적으로
2계약중에서 1계약만 청산된 상태에서 반대 시그널이 발생했을때
보유하고 있던 모든 계약을 청산시키고 발생된 시그널 방향으로 진입하는 부분이 궁금합니다..
1
input : Per1(10),Per2(25);
var : BH(0),SL(0);
if MarketPosition == 1 Then
{
BH = highest(H,BarsSinceEntry);
if BH >= EntryPrice+PriceScale*65 Then
ExitLong("bx1",AtStop,BH-(BH-EntryPrice)*(Per1/100),"",1,1);
if BH >= EntryPrice+PriceScale*185 Then
ExitLong("bx2",AtStop,BH-(BH-EntryPrice)*(Per2/100),"",1,1);
}
if MarketPosition == -1 Then
{
SL = Lowest(L,BarsSinceEntry);
if SL <= EntryPrice-PriceScale*65 Then
ExitShort("sx1",AtStop,SL+(EntryPrice-SL)*(Per1/100),"",1,1);
if BH >= EntryPrice+PriceScale*185 Then
ExitShort("sx2",AtStop,SL+(EntryPrice-SL)*(Per2/100),"",1,1);
}
2
input : tick1(10),Tick2(25);
var : BH(0),SL(0);
if MarketPosition == 1 Then
{
BH = highest(H,BarsSinceEntry);
if BH >= EntryPrice+PriceScale*65 Then
ExitLong("bx1",AtStop,BH-Tick1*PriceScale,"",1,1);
if BH >= EntryPrice+PriceScale*185 Then
ExitLong("bx2",AtStop,BH-Tick2*PriceScale,"",1,1);
}
if MarketPosition == -1 Then
{
SL = Lowest(L,BarsSinceEntry);
if SL <= EntryPrice-PriceScale*65 Then
ExitShort("sx1",AtStop,SL+Tick1*PriceScale,"",1,1);
if BH >= EntryPrice+PriceScale*185 Then
ExitShort("sx2",AtStop,SL+Tick2*PriceScale,"",1,1);
}
2021-04-05
1100
글번호 147705
시스템