I was wondering if there is a way to create a pending order that doesn't disappear the next bar. I mean, I started recently with MC.NET, and for what I got so far, after a pending order is placed, let's say a sell stop, if it is not triggered during the next bar, that order won't exist anymore for the bars coming afterwards.
I've been going around this by recording the stop price, and placing the order every time the CalcBar method is called. It definitely doesn't look like the ideal solution. Is it possible to place a stop order in a way that it stays alive untill it is triggered, untill it is deleted , or untill expiration?
This is what I've done:
Code: Select all
if(Bars.TimeValue == MyTime){
PriceUp=Bars.High[0]+0.0020;
PriceDown=Bars.Low[0]-0.0020;
}
if(Bars.TimeValue >= OraNews && CurrentPosition.Side == EMarketPositionSide.Flat)){
buy_order.Send(PriceUp);
sell_order.Send(PriceDown);
}
Code: Select all
if(Bars.TimeValue == MyTime){
buy_order.Send(Bars.High[0]+0.0020);
sell_order.Send(Bars.Low[0]-0.0020);
}
Manuel