Permanent Pending Orders

Questions about MultiCharts .NET and user contributed studies.
ManuelVene
Posts: 17
Joined: 12 Jun 2015
Been thanked: 1 time

Permanent Pending Orders

Postby ManuelVene » 18 Oct 2015

Hello!
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);
}
This is what I would like but without the order being killed the bar after (if a way exists):

Code: Select all

if(Bars.TimeValue == MyTime){
buy_order.Send(Bars.High[0]+0.0020);
sell_order.Send(Bars.Low[0]-0.0020);
}
Thanks,
Manuel

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Permanent Pending Orders

Postby Henry MultiСharts » 19 Oct 2015

Hello Manuel,

You can try using the unmanaged orders approach.


Return to “MultiCharts .NET”