Unfilled Strategy Order Replacement - clarifications needed

Questions about MultiCharts and user contributed studies.
moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Unfilled Strategy Order Replacement - clarifications needed

Postby moses » 29 Oct 2013

Hello,

I am trying to achieve the following without success:
a - using an automated strategy on a 4-hour chart
b - i want to enter a position on the close of the bar by using a limit order
c - and if my limit order is not filled, I want my order to become a market order in, say, 20 seconds so I can get my fill at the prevailing price.

So what I do is:

1 - my strategy says: Buy xxx contracts next bar at myprice limit
2 - then I check the 'Unfilled strategy order replacement' box and enter 20 seconds in the relevant box

Unfortunately, if the order is not filled immediately (say there is no partial fill either), the market order doesn't ever kick in.

What am I doing wrong?

Thanks a lot
Andreas

Note: I use Interactive Brokers as the broker, and TS for the data feed. In the strategy properties, I 'Get Real-Time Data from' the Broker.
I don't know if it matters at all, but I noticed that the IB feed is 1-2 pips (in EUR/USD for example) above the TS feed (on which my charts are based).

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

Re: Unfilled Strategy Order Replacement - clarifications nee

Postby Andrew MultiCharts » 29 Oct 2013

Hello Moses,

The Unfilled Strategy Order Replacement works if current price touches or crosses your limit order price, only then the 20 seconds countdown starts. If the market price has never reached or crosses your entry limit order, it will not be converted.
Take into account that this feature also allows you to control what is "market price" in this case: ask/bid at broker or current price on chart.

moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Re: Unfilled Strategy Order Replacement - clarifications nee

Postby moses » 30 Oct 2013

Thanks Andrew, I think I will figure it out.

I have one more simple question, please.

My strategy says:
myentryprice = close;
Buy xxx contracts next bar at myentryprice limit;

My question is, is myentryprice always the close on the chart, or it can be the close of the broker data if I use the Get Real-Time Data from Broker?
I am assuming that the strategy always uses the chart data, but just to be sure!

Thanks again
moses

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

Re: Unfilled Strategy Order Replacement - clarifications nee

Postby Andrew MultiCharts » 30 Oct 2013

If you use "Close" keyword it is always the data from a chart. But you can add asks and bids as additional data series to your chart and reference them from script:

Code: Select all

myentryprice = close of data2;
Buy xxx contracts next bar at myentryprice limit;

moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Re: Unfilled Strategy Order Replacement - clarifications nee

Postby moses » 01 Nov 2013

Andrew, I refer to your first answer above in which you note:
QUOTE
The Unfilled Strategy Order Replacement works if current price touches or crosses your limit order price, only then the 20 seconds countdown starts. If the market price has never reached or crosses your entry limit order, it will not be converted.
UNQUOTE


Say I am using hourly charts, and the latest hourly bar closed at 1.4000.
My strategy now instructs: Buy xxx contracts next bar at 1.4000 limit
The next bar opens at 1.4001 and proceeds to go higher from there on, i.e. it never touches 1.4000 again.

If I have Unfilled Strategy Order Replacement checked, will it kick in, or will it be ignored because the market price is now 1.4001, therefore it's assumed that it never touched my limit price of 1.4000?

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

Re: Unfilled Strategy Order Replacement - clarifications nee

Postby Andrew MultiCharts » 01 Nov 2013

Say I am using hourly charts, and the latest hourly bar closed at 1.4000.
My strategy now instructs: Buy xxx contracts next bar at 1.4000 limit
The next bar opens at 1.4001 and proceeds to go higher from there on, i.e. it never touches 1.4000 again.

If I have Unfilled Strategy Order Replacement checked, will it kick in, or will it be ignored because the market price is now 1.4001, therefore it's assumed that it never touched my limit price of 1.4000?
The buy limit at 1400 order will not be converted into market order after X seconds if current price doesn't become 1400 or any lower.

moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Re: Unfilled Strategy Order Replacement - clarifications nee

Postby moses » 01 Nov 2013

Thanks Andrew.

The problem is that this seems like a dead-end.
How can I then turn a limit order into a market order when the market is moving away from me, like in the example I gave?

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

Re: Unfilled Strategy Order Replacement - clarifications nee

Postby Andrew MultiCharts » 01 Nov 2013

Well, in your case the only way is to recalculate script intrabar (IOG should be enabled), monitoring the current price and if it is moving against you and replacing the existing order with a market one when needed.


Return to “MultiCharts”