How to monitor rejected and pending orders wt Powerlanguage  [SOLVED]

Questions about MultiCharts and user contributed studies.
wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

How to monitor rejected and pending orders wt Powerlanguage

Postby wilkinsw » 14 Jul 2013

Hi,

Is there anyway to use powerlanguage to query the number of pending orders and/or flag up rejected orders?

I've got a bug that I'm struggling to fix:

If long and am working a stoploss that is sitting (by chance) a couple of prices in front of a sellshort entry level. Then if price blips through both levels two things can happen:

1) if not using optimise order flow: if was long 1 lot, will now be short 2 lots, due to overfill.

2) if using optimise order flow: get stopped out, then the sell stoplimit order is submitted, upon which it is rejected by Patsystems due to price now being below the stop trigger.

I could remedy the asynch event by submitting a placemarketorder. However, my system has been designed to enter with stoplimits, hence hitting any price with a market order following a blip is not acceptable.

Therefore, if there was a way to detect the rejected order then I could code a response. Alternatively if there was away to count the number of working orders then I would be able to tell if my stoplimit order simply missed the market, hence is still being worked, requiring no intervention.

Thanks in advance for your help.

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

Re: How to monitor rejected and pending orders wt Powerlangu

Postby Henry MultiСharts » 24 Jul 2013

Hello wilkinsw,

Unfortunately there is no way to detect the rejected order or to count the number of working orders in PowerLanguage at the moment.

This functionality is available in MultiCharts .Net.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: How to monitor rejected and pending orders wt Powerlangu

Postby wilkinsw » 24 Jul 2013

As a possible work around:

If a strategy on a chart is restricted in the number of contracts in the same direction that it can go, under "strategy properties", to one order only, then......

If I use something like the strategy to broker synchronizer to send a corrective order in case of a rejected order (but coded to use a limit order, not market).......

Then if it turned out that my system hadn't actually had an order rejected but was actually still working a limit order left from an unfilled stoplimit entry order then........

A) Would this result in the corrective limit order from the synchronizer being rejected as the settings for the strategy is for only one order in one direction??

OR

B) The setting on number of orders in the same direction have no bearing and I'm now working an order for 2 lots at said limit price instead of desired one?

Thanks!!

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: How to monitor rejected and pending orders wt Powerlangu  [SOLVED]

Postby Andrew MultiCharts » 15 Oct 2013

Please read about this feature scheduled for MC 9.1: https://www.multicharts.com/pm/viewissu ... no=MC-1497


Return to “MultiCharts”