"Fill Limit Order when trade price goes beyond limit price"  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

"Fill Limit Order when trade price goes beyond limit price"

Postby MAtricks » 11 Jul 2013

It is rare to have a reliable back-test with limit orders. To reduce unpredictability of your strategy's past performance we have the option to only simulate a fill if "price goes beyond limit price by X points (should be called ticks). This feature never seems to work correctly in MC. Some times it's overly optimistic and some times it's overly pessimistic.

In this screen shot it's overly optimistic:

Image

-IBOG is turned off
-Entry logic is:
Buy next bar open limit ;
Sellshort next bar open limit ;

As you can see, the price doesn't fulfill a tick beyond the open price on over half of the orders.
Attachments
Limit_orders_bug.png
(116.08 KiB) Downloaded 9775 times

User avatar
t-rader
Posts: 139
Joined: 02 Feb 2011
Location: Australia
Has thanked: 11 times
Been thanked: 27 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby t-rader » 12 Jul 2013

without bar magnify on can't MC only show entries/exits in 1 of 4 places those being OHLC? Wouldn't it be more accurate if you had tick data and bar magnify enabled?

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 12 Jul 2013

If I had my entry on anything other than those 4 entries, then yes, but in this case it's a simple test strategy which is executing on the open (one of those 4).

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 15 Jul 2013

I'm also finding that while turning on "Fill Limit Order when trade price goes [Xpoints] beyond limit price" my fill in a back-test will actually be XPoints away. Weird?..

It seems to me that everything dealing with limit orders needs to be fine-tuned in MC.

User avatar
Henry MultiСharts
Posts: 9132
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2929 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Henry MultiСharts » 26 Jul 2013

Hello MAtricks,

"Fill Limit Order when trade price goes beyond limit price" works the following way:
A Limit order will execute at the specified price or better if the limit price - N ticks for Long position/ + N ticks for Short position specified in the Backtesting Assumption option price is met.

The test script is calculated on the bar close. It is considered that all prices were within the bar (Intra-bar Price movement assumption is used). Order is filled on any price within the bar.

When the script is calculated on the bar close - it takes the current bar's open value and forms the order price. The order is “sent” on the next bar open.

Let’s take the first highlighted buy order for analysis. Order execution bar = current bar. Take the open of the previous bar (strategy was calculated on this bar and used it’s open price for limit order generation) – 1 tick specified in the Backtesting Assumption option – such price is available on the current bar. Order is filled at the first price satisfying the limit order rules.

Let’s take the first highlighted sell order for analysis. Take the open of the previous bar + 1 tick specified in the Backtesting Assumption option – such price is available on the current bar. Order is filled at the first price satisfying the limit order rules.

That means "Fill Limit Order when trade price goes beyond limit price" works as expected and there is no bug.
Image
Attachments
Limit_orders_assumption.png
(152.05 KiB) Downloaded 9660 times

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 26 Jul 2013

Interesting...

So:
Buy next bar open limit ;
and
Sell next bar open limit ;

Actually means:
Buy next bar open[1] limit ;
and
Sell next bar open[1] limit ;
?

I'm shaking my head a bit on this one... How would we place a limit order on the "next bar" open?

User avatar
Henry MultiСharts
Posts: 9132
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2929 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Henry MultiСharts » 31 Jul 2013

When the script is calculated on the bar close (IOG Off) - it takes the current bar's open value and forms the order price. The order is “sent” on the next bar open.

If you want to send an order with the open price of the current bar then you need to turn on IOG, once the strategy is calculated on bar's opening tick you can assign this opening price to your order and send the order on the next tick.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 31 Jul 2013

Thank you Henry.

I don't want this particular strategy to have IOG on so I coded up a small function to find the open of the new bar based off the close plus or minus the tick value. It seems to be working well :)

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 30 Sep 2013

When the script is calculated on the bar close (IOG Off) - it takes the current bar's open value and forms the order price. The order is “sent” on the next bar open.

If you want to send an order with the open price of the current bar then you need to turn on IOG, once the strategy is calculated on bar's opening tick you can assign this opening price to your order and send the order on the next tick.
Henry, I believe this to be incorrect. Why would we ever want to place an order at the open of the last bar? There's no world that this makes sense in... I did tests in TS to compare and sure enough.. for once they had it right. Also while referencing the Easy Language Essentials Guide I find this quote on page 95:
http://www.TS.com/~/media/Fil ... tials.ashx

Code: Select all

Open Next Bar
Strategies, by default, calculate on the close of each bar and generate orders into the next bar. However, traders
often want to base their strategy rules on the open of the next new bar. Open Next Bar syntax allows the
calculation engine to delay the strategy calculation until the opening tick of the next bar, and allows you to
reference that opening price in your strategy conditions for orders on that same bar.
Usage Example:
Buy next bar at open next bar - .05 Limit;
(The syntax ‘Open Next Bar’ refers to the opening price of the next bar.)
In this example, we delay the strategy calculation with ‘open next bar’ until the opening tick and then
use that opening price in our order.
Errors like this create extremely optimistic back-tests...

For anyone that would like to execute on the next bar's open price all I do is:

Code: Select all

buy next bar C-ticksize ;
Sellshort next bar C+ticksize ;
Which will give you the best scenario I can think up.. It'd be great if MC would provide the open of the current bar though!!

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 08 Oct 2013

I guess this follows on this topic so I'll post it here..

When turning on FILL LIMIT ORDER WHEN TRADE GOES BEYOND LIMIT PRICE BY [x] POINTS, the limit orders are executed on X "points" in a back-test which is wrong. The execution price should not change, it should just be verified that the price did in fact go through the order X amount of points.

Example:
Orders are placed the yellow and blue arrows, but the back-test is showing that they're +1 tick of profit because of turning on this valuable but broken feature:
Image

Now I turn it off which shows me the correct execution price, but doesn't filter out the trades that price didn't go through 1 "point" (should be called tick) as is needed with a back-test.
Image
Attachments
backtest_without_FL+1.png
(5.83 KiB) Downloaded 9500 times
backtest_with_FL+1.png
(6.64 KiB) Downloaded 9523 times
Last edited by MAtricks on 08 Oct 2013, edited 1 time in total.

jstoetz
Posts: 7
Joined: 21 Aug 2013
Has thanked: 2 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby jstoetz » 08 Oct 2013

You hit on a big issue I think that has been pointed out with backtesting limit orders (I reviewed the most recent release and I don't believe it was fixed).

If I go and check "FILL LIMIT ORDER WHEN TRADE GOES BEYOND LIMIT PRICE BY 1 POINTS" (which by the way "points" really means "ticks") --->

For example, I would assume that if my strategy entered a short limit order on the @ES for 1600 that I would only get filled at 1600 if the next bar actually went to 1600.25. This is not the case.

In the backtest, you actually get filled at 1600.25 (which was similar to what you showed in the picture above MATricks).

This post breaks it down too: http://www.multicharts.com/discussion/v ... rder+when+

According to Dave: "the order is filled at current price after [exceeding] limit price on a specified number of points"

However, I think we enter trades with limit orders to protect ourselves. That is, we want a specific price point. In backtesting, we can only be assured of a fill on a limit order if the price goes through our price point. As the original poster put it "The point of the backtesting assumption is to only allow trades if the market moves pass the limit price to ensure a fill."

The Wiki breaks it down here: https://www.multicharts.com/trading-sof ... ssumptions

#2 on that list is where the problem lies:

"Chart resolution is 1 tick or Bar Magnifier of any resolution is enabled. Backtesting Assumptions is set to Fill limit order when trade price goes beyond limit price by 3 points.
Example: Generated order: sellshort limit @ 121; available prices: 120, 122, 125, ...; order is filled @ 125."

I think the wording under the "Backtesting Assumptions" leads you to belive that you get filled at your intended limit price rather than limit price +/- 1 tick/point. It can lead to errors in your backtesting.

According to this post: viewtopic.php?f=1&t=10478&hilit=limit+o ... order+when+

If we turn off IOG and Bar Magnifier we could " get the order filled at exact price- use regular historical calculation mode"

I think that that falls under #3 above:

"Chart resolution is not 1 tick and Bar Magnifier is not enabled. Backtesting Assumptions is set to Fill limit order when trade takes place at limit price or better.
Example: Generated order: sellshort limit @ 121; order is filled @ 121 or better if 121 (or better) is between High and Low of the bar."

However, this loses the best part about MC - that we can use IOG and bar magnifier.

This would seem like a simple fix. I think there is a voting link here to fix it but there has been no progress as of late:

http://www.multicharts.com/pm/viewissue ... _no=MC-149

jstoetz
Posts: 7
Joined: 21 Aug 2013
Has thanked: 2 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby jstoetz » 17 Oct 2013

Just a quick update since we didn't get a response from anyone at MC regarding this issue.

TS apparently offers the ability to have the price exceed the limit order for the strategy order to be filled in backtesting. Under TS, you go to Format->Strategies->Properties for All then click on the Backtesting Tab. Click on the second option "Fill entire order when trade price exceeds limit price." So if you enter a limit order on a stock for $10 next bar, then the price must go to 10.01 for the order to be filled in backtesting.

MC - I know you guys can fix this!

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 17 Oct 2013

Multicharts has that feature as well.. It just doesn't work -that's the threads topic :)

User avatar
Henry MultiСharts
Posts: 9132
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2929 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Henry MultiСharts » 17 Oct 2013

When the script is calculated on the bar close (IOG Off) - it takes the current bar's open value and forms the order price. The order is “sent” on the next bar open.

If you want to send an order with the open price of the current bar then you need to turn on IOG, once the strategy is calculated on bar's opening tick you can assign this opening price to your order and send the order on the next tick.
Henry, I believe this to be incorrect. Why would we ever want to place an order at the open of the last bar? There's no world that this makes sense in... I did tests in TS to compare and sure enough.. for once they had it right. Also while referencing the Easy Language Essentials Guide I find this quote on page 95:
http://www.TS.com/~/media/Fil ... tials.ashx

Code: Select all

Open Next Bar
Strategies, by default, calculate on the close of each bar and generate orders into the next bar. However, traders
often want to base their strategy rules on the open of the next new bar. Open Next Bar syntax allows the
calculation engine to delay the strategy calculation until the opening tick of the next bar, and allows you to
reference that opening price in your strategy conditions for orders on that same bar.
Usage Example:
Buy next bar at open next bar - .05 Limit;
(The syntax ‘Open Next Bar’ refers to the opening price of the next bar.)
In this example, we delay the strategy calculation with ‘open next bar’ until the opening tick and then
use that opening price in our order.
Errors like this create extremely optimistic back-tests...
Orders are filled differently in TS backtesting. In TS you can have orders filled between the bars where there was no actual price action. In MultiCharts we do not fill an order without an actual price for it.
In the example above - even if you generate an order with the current bar’s Open limit price– the order will be filled at the same price on the same bar. That will not change the behavior.
This is considered to be the correct and expected behavior.

User avatar
Henry MultiСharts
Posts: 9132
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2929 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Henry MultiСharts » 17 Oct 2013

I guess this follows on this topic so I'll post it here..

When turning on FILL LIMIT ORDER WHEN TRADE GOES BEYOND LIMIT PRICE BY [x] POINTS, the limit orders are executed on X "points" in a back-test which is wrong. The execution price should not change, it should just be verified that the price did in fact go through the order X amount of points.

Example:
Orders are placed the yellow and blue arrows, but the back-test is showing that they're +1 tick of profit because of turning on this valuable but broken feature:
Image
The limit order is not executed on X "points". A Limit order is executed at the specified price or better. The execution price does not change. It is verified that the price went through the order X amount of points and the order is filled on the nearest actual price present on the chart that satisfies the limit order execution conditions. Order cannot be filled between the bars without price action.
Now I turn it off which shows me the correct execution price, but doesn't filter out the trades that price didn't go through 1 "point" (should be called tick) as is needed with a back-test.
Image
Turning off the option causes the strategy to be recalculated. Without this option you have different execution for orders before the mentioned bar. As you can see the Short entry filled on a different bar, therefore the provided picture represents a different calculation that cannot be compared to picture1.

User avatar
Henry MultiСharts
Posts: 9132
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2929 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Henry MultiСharts » 17 Oct 2013

You hit on a big issue I think that has been pointed out with backtesting limit orders (I reviewed the most recent release and I don't believe it was fixed).

If I go and check "FILL LIMIT ORDER WHEN TRADE GOES BEYOND LIMIT PRICE BY 1 POINTS" (which by the way "points" really means "ticks") --->For example, I would assume that if my strategy entered a short limit order on the @ES for 1600 that I would only get filled at 1600 if the next bar actually went to 1600.25. This is not the case.

However, I think we enter trades with limit orders to protect ourselves. That is, we want a specific price point. In backtesting, we can only be assured of a fill on a limit order if the price goes through our price point. As the original poster put it "The point of the backtesting assumption is to only allow trades if the market moves pass the limit price to ensure a fill."

This would seem like a simple fix. I think there is a voting link here to fix it but there has been no progress as of late:

http://www.multicharts.com/pm/viewissue ... _no=MC-149
Just a quick update since we didn't get a response from anyone at MC regarding this issue.

TS apparently offers the ability to have the price exceed the limit order for the strategy order to be filled in backtesting. Under TS, you go to Format->Strategies->Properties for All then click on the Backtesting Tab. Click on the second option "Fill entire order when trade price exceeds limit price." So if you enter a limit order on a stock for $10 next bar, then the price must go to 10.01 for the order to be filled in backtesting.

MC - I know you guys can fix this!
Multicharts has that feature as well.. It just doesn't work -that's the threads topic :)
There is no issue with the mentioned functionality. The feature works as it is designed to work. You are just asking for a different behavior described in the mentioned PM entry (Variant 2):
http://www.multicharts.com/pm/viewissue ... _no=MC-149

jstoetz
Posts: 7
Joined: 21 Aug 2013
Has thanked: 2 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby jstoetz » 17 Oct 2013

First, thank you for responding.
The limit order is not executed on X "points". A Limit order is executed at the specified price or better. The execution price does not change. It is verified that the price went through the order X amount of points and the order is filled on the nearest actual price present on the chart that satisfies the limit order execution conditions. Order cannot be filled between the bars without price action.
I think we all agree that the limit order can be filled at the limit price or better. What we are requesting is that MC offer an option in later editions that allows you to ensure that the limit price you specify in the strategy satisfies BOTH of the following (1) price exceeds the limit price you specify in the strategy limit order AND (2) you are filled at the limit price you specify in the order (and not the limit price + [X] points).

If this were possible, then we could ensure that "worst case" we get filled at the price we specify and "best case" we get filled at a better price.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 17 Oct 2013

Henry, thanks for responding.

I'm unsure where to go from here.. I stare at this platform 18 hours a day in real time and am frustrated with the flaws that you say aren't there.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 17 Oct 2013

I think we all agree that the limit order can be filled at the limit price or better. What we are requesting is that MC offer an option in later editions that allows you to ensure that the limit price you specify in the strategy satisfies BOTH of the following (1) price exceeds the limit price you specify in the strategy limit order AND (2) you are filled at the limit price you specify in the order (and not the limit price + [X] points).

If this were possible, then we could ensure that "worst case" we get filled at the price we specify and "best case" we get filled at a better price.
I am afraid there is a misunderstanding here, either from our end or from yours. Let me make sure we are talking the same things.

A limit order is an order to buy/sell at Y price or better (for buy limit better = lower; for sell limit better = higher).

The Backtesting Assumption for limit orders has 2 options:
  • Fill limit order at Y price or better (for buy limit better = lower; for sell limit better = higher) - in this case simply the first best available price for order execution is taken.
  • Fill limit order at Y price or better, but only if there N ticks beyond (for buy limit better = lower - N ticks; for sell limit better = higher + N ticks). In this case, backtesting engine checks if there is a price within a bar that is N ticks beyond the limit order price and if there is the order is filled at the same price as in previous option (the first best available price). If there is no such price within a bar (the limit order price +/- N ticks), the limit order is not executed at all.
Let's look into the following example:

Buy limit at 100:
  • Fill limit order at Y price or better (lower); OHLC = 98-99-90-91; the order is filled at 98 because this is the first best available price and it meets the limit order execution criteria.
  • Fill limit order at Y price or better (lower), but only if there N ticks beyond (100-N); OHLC = 98-99-90-91; If N = 1, the backtesting engine sees that the price 99 (100-1) is present (high), the order is filled at 98 because this is the first best available price and it meets the limit order execution criteria; If N = 11, the backtesting engine sees that the price 89 (100-11) is not present, the order is not filled at all because there is no 89 price within the bar;.
Please explain what other option do you want.
I'm unsure where to go from here.. I stare at this platform 18 hours a day in real time and am frustrated with the flaws that you say aren't there.
Everything described in this thread is expected behavior. if you want it to work differently, please describe it and we will discuss it with our management.

jstoetz
Posts: 7
Joined: 21 Aug 2013
Has thanked: 2 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby jstoetz » 17 Oct 2013

Again, thank you for the response(s).

From my experience, the issue arises when you get filled in backtesting at a price bar extreme.

Say you have a buy strategy where you want to enter a limit order to buy at the Low[1]. Assume the Low[1] is 100 and the next bar triggers it and sends a buy limit order at 100.

Buy limit at 100:

Under the current setup Option #1:
- Fill limit order at Y price or better (lower): OHLC of entry bar=100-101-99-100; the order would be filled at 99 because this is the first best available price and it meets the limit order execution criteria. In reality, this price is at the tail of the bar so there is no guarantee that you would get a fill.

Under the current setup Option #2 (and just assume that N=1):
- Fill limit order at Y price or better (lower), but only if there N ticks beyond (100-N); OHLC =100-101-99-100; Since N = 1, the backtesting engine sees that the price 99 (100-1) is present (low), the order is filled at 99 because this is the first best available price and it meets the limit order execution criteria
img1.JPG
(10.43 KiB) Downloaded 8695 times
Under the option I am suggesting:
- Fill limit order at Y price: OHLC=100-101-99-100; the order would only be filled at 100 (the limit price in the strategy) only because the price went to 99.

Maybe there is an EasyLanguage option for this?

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 17 Oct 2013

Buy limit at 100:

Under the current setup Option #1:
- Fill limit order at Y price or better (lower): OHLC of entry bar=100-101-99-100; the order would be filled at 99 because this is the first best available price and it meets the limit order execution criteria. In reality, this price is at the tail of the bar so there is no guarantee that you would get a fill.
That is negative, Sir. The first best available price and it meets the limit order execution criteria here is open = 100. The order would be filled at 100.
Under the current setup Option #2 (and just assume that N=1):
- Fill limit order at Y price or better (lower), but only if there N ticks beyond (100-N); OHLC =100-101-99-100; Since N = 1, the backtesting engine sees that the price 99 (100-1) is present (low), the order is filled at 99 because this is the first best available price and it meets the limit order execution criteria
That is negative, Sir. The backtesting engine sees that the price 99 (100-1) is present (low). The first best available price and it meets the limit order execution criteria here is open = 100. The order would be filled at 100.
Under the option I am suggesting:
- Fill limit order at Y price: OHLC=100-101-99-100; the order would only be filled at 100 (the limit price in the strategy) only because the price went to 99.
You are welcome to provide us with the following set of files demonstrating a different behavior, i'd be glad to study the case:
  1. The workspace to reproduce the situation.
  2. Export of used symbol (with data) from QuoteManager in .qmd archive,
  3. The exported signal with all dependent functions that applied on the workspace.
  4. Specify the bar number where the problematic order is filled at a wrong price.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 17 Oct 2013

I guess this follows on this topic so I'll post it here..

When turning on FILL LIMIT ORDER WHEN TRADE GOES BEYOND LIMIT PRICE BY [x] POINTS, the limit orders are executed on X "points" in a back-test which is wrong. The execution price should not change, it should just be verified that the price did in fact go through the order X amount of points.

Example:
Orders are placed the yellow and blue arrows, but the back-test is showing that they're +1 tick of profit because of turning on this valuable but broken feature:
Image
The limit order is not executed on X "points". A Limit order is executed at the specified price or better. The execution price does not change. It is verified that the price went through the order X amount of points and the order is filled on the nearest actual price present on the chart that satisfies the limit order execution conditions. Order cannot be filled between the bars without price action.
Now I turn it off which shows me the correct execution price, but doesn't filter out the trades that price didn't go through 1 "point" (should be called tick) as is needed with a back-test.
Image
Turning off the option causes the strategy to be recalculated. Without this option you have different execution for orders before the mentioned bar. As you can see the Short entry filled on a different bar, therefore the provided picture represents a different calculation that cannot be compared to picture1.
Henry,
This is not realistic. Which is where I was going with this topic initially. A limit order is filled at its price or better. However, that "or better" does NOT happen very often.. and especially not every bar. If a buy limit order is placed at 100, it will fill at 100, not 99. However, this function that you're saying is working properly is telling me exactly that. It's something to look into...

Andrew,
Thank you for allowing me to post my concerns so that management can consider them. I believe I currently take advantage of this. :)

Both of you,
I'm sorry if my frustration has shown through my text. I feel like I report issues and then my work is finished, but I'm simply argued with until I walk MC through the problem step by step which I don't think is fair. I just want MC to be the best.... and frankly I think that I've put in a lot of free work to better this product. Maybe I'm not the best at explaining the issues. We're doing good, but there are several of these issues that are simply NOT realistic regardless if they're "expected behavior" or not.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 17 Oct 2013

Henry,
This is not realistic. Which is where I was going with this topic initially. A limit order is filled at its price or better. However, that "or better" does NOT happen very often.. and especially not every bar. If a buy limit order is placed at 100, it will fill at 100, not 99. However, this function that you're saying is working properly is telling me exactly that. It's something to look into...
If you don't mind, i'll let myself explain what Henry mentioned in his post releated to the pictures.
  • The pictures show 2 absolutely different cases. If they had the sellshort entry at exact the same bar and at exact the same price, you would be right. But since the entries are different, the exits can be different too. Why the entries are different? Most likely some other previos orders are different because by switching the limit order assumptions for backtesting you recalculate script on the data series and some orders are supposed to be filled/not filled at different bars.
  • Now if we focus on the first picture (where the buy exit order is filled at open), we will see that the order is filled at the first available price, meeting the criteria of limit order execution. Any order should be filled within a bar, so it can be filled at price marked by the teal dot on this bar, since there is no such price within this bar. If you believe the order should have been executed at previous bar at its original price, please print order generation from script to find out when execatly the buy limit order was generated by the script.
Both of you,
I'm sorry if my frustration has shown through my text. I feel like I report issues and then my work is finished, but I'm simply argued with until I walk MC through the problem step by step which I don't think is fair. I just want MC to be the best.... and frankly I think that I've put in a lot of free work to better this product. Maybe I'm not the best at explaining the issues. We're doing good, but there are several of these issues that are simply NOT realistic regardless if they're "expected behavior" or not.
Thank you, Matricks. We do appreciate your time and effort. Our first goal is to make sure there is no bug. If there is one, we do our best to fix it. If what you are looking for is a feature not yet available in the software, we can discuss its implementation for future versions of MC if you describe what exectly you would like us to do.
Speaking about this particular case, I think it is realistic and expected behavior and I believe Henry and i explained why.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 17 Oct 2013

Andrew,

Thank you for touching on this topic so quickly.

Yes, you're correct. The orders do change. This is just a reversal testing strategy..

From you pointing that out, I see an even larger issue.. but your conclusion was that there wasn't any?

The orders change.. which is odd because all I did was select and deselect the FILL LIMIT ORDER WHEN TRADE PRICE GOES BEYOND PRICE BY 1 POINT option. However, if you see my live execution you will notice that REAL orders do not change. The entire point of looking at how these back-tests "execute" is to make them as close to the real world as possible. While comparing live execution and the back-test and changing only one feature, this is the result. I'm unsure how we can conclude that this is a working product?

If the back-test doesn't match the live execution, something is wrong. (cyan and yellow arrows are live execution). The chart was trading and all I did was copy/paste the window so I had the live orders + the back-test.

Those 2 pictures say it all.. Live executed orders along with the back-tests that are different when changing one fill option. This doesn't make me feel warm and fuzzy about Multicharts back-tests its orders..

jstoetz
Posts: 7
Joined: 21 Aug 2013
Has thanked: 2 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby jstoetz » 18 Oct 2013

Buy limit at 100:

Under the current setup Option #1:
- Fill limit order at Y price or better (lower): OHLC of entry bar=100-101-99-100; the order would be filled at 99 because this is the first best available price and it meets the limit order execution criteria. In reality, this price is at the tail of the bar so there is no guarantee that you would get a fill.
That is negative, Sir. The first best available price and it meets the limit order execution criteria here is open = 100. The order would be filled at 100.
Under the current setup Option #2 (and just assume that N=1):
- Fill limit order at Y price or better (lower), but only if there N ticks beyond (100-N); OHLC =100-101-99-100; Since N = 1, the backtesting engine sees that the price 99 (100-1) is present (low), the order is filled at 99 because this is the first best available price and it meets the limit order execution criteria
That is negative, Sir. The backtesting engine sees that the price 99 (100-1) is present (low). The first best available price and it meets the limit order execution criteria here is open = 100. The order would be filled at 100.
The way I described the backtest with the fills at 99 under Option #1 and #2 is the actual results that I got in backtesting the strategy regardless of how the engine should work. If you look at the picture I attached, you will see a long entry at the low of the bar when actually the limit order was for the middle of the bar. This happens over and over again in backtesting. Will forward you the requested information. Thanks Andrew!

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 18 Oct 2013

Dear MAtricks,

Let me address your every statement in order to express myself as clearly as possible and be understood.
From you pointing that out, I see an even larger issue.. but your conclusion was that there wasn't any?
I believe this is where there is some misunderstanding. What you consider to be an issue is not actually one. It is the difference in results of 2 separate independent strategy calculations and further i will do my best to explain why the results are different, why it is expected and simply cannot be the other way.
The orders change.. which is odd because all I did was select and deselect the FILL LIMIT ORDER WHEN TRADE PRICE GOES BEYOND PRICE BY 1 POINT option.
My first point is that by changing literally any setting of backtesting/auto trading, you make the script be recalculated and not simply recalculated to give you the same results, different settings = different results. So when you change any setting, you should expect different calculation results (orders generated/filled/not filled at different bars/prices and so on).
if you see my live execution you will notice that REAL orders do not change. The entire point of looking at how these back-tests "execute" is to make them as close to the real world as possible. While comparing live execution and the back-test and changing only one feature, this is the result. I'm unsure how we can conclude that this is a working product?

If the back-test doesn't match the live execution, something is wrong. (cyan and yellow arrows are live execution).
This is the key point. Backtesting, forward testing (real-time calculation, AT is off) and automated trading results can be different in some cases. This is expected because some factors affecting real-time strategy execution results (at broker account) cannot be emulated in backtesting and in forward testing.
First of all it is hard to make the starting point of a historical strategy calculation be the same as when you started auto trading in real-time with your broker. Different starting points = different results. Please read our MC Wiki page to learn more about reasons of different backtesting and real-time auto trading results.
The chart was trading and all I did was copy/paste the window so I had the live orders + the back-test.
A strategy is recalculated (backtested) when:
  1. MC is closed and restarted,
  2. AT is turned on,
  3. AT is turned off,
  4. Any setting from Strategy Properties is changed and OK is clicked,
  5. Any setting of any signal in Format Signal: ... is changed and OK is clicked,
  6. Any setting of the chart is changed and OK is clicked,
  7. Chart is reloaded,
  8. Chart is copy-pasted (the strategy is recalculated on the copy of the original chart),
  9. Any signal script is recompiled in PLE,
As i have (indirectly) written above: if a strategy is recalculated after it was auto-trading, it is backtested. The results can be different.
Those 2 pictures say it all..
MAtricks, as i understand, the first picture shows auto-trading results and the second picture shows backtesting results. I have to say that the 2 pictures showing different results do not show any problem.
Even if they both show the backtesting results, as i have mentioned in my very first point, adjustment of any setting possibly leads to different strategy calculation results.
Just a simple example for such case:
  1. Your strategy (backtesting, "Fill limit order at Y price or better" is selected) places an exit limit order at bar, let's say, # 1000.
  2. It is filled at open.
  3. Next entry order is generated and then filled at bar, let's say, # 1100 and so on...
  4. You change the limit order assumption to "Fill limit order at Y price or better, but only if there are N ticks beyond", the strategy is recalculated,
  5. Your strategy places an exit limit order at bar, let's say, # 1000
  6. It is NOT filled at open because there are no N ticks beyond,
  7. Next entry order is NOT generated and NOT filled at bar # 1100. It is filled at bar, let's say, 1200.
All further strategy orders and strategy calculation results in general are different because you changed 1 setting.
Live executed orders along with the back-tests that are different when changing one fill option. This doesn't make me feel warm and fuzzy about Multicharts back-tests its orders..
I understand your goal to have the same backtesting, forwardtesting and real-time auto trading results. I do agree that it would be extremely useful, however as i previously said, there are some limitations, which prevent backtesting from being as realistic as auto-trading in real time.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 18 Oct 2013

The way I described the backtest with the fills at 99 under Option #1 and #2 is the actual results that I got in backtesting the strategy regardless of how the engine should work. If you look at the picture I attached, you will see a long entry at the low of the bar when actually the limit order was for the middle of the bar. This happens over and over again in backtesting. Will forward you the requested information. Thanks Andrew!
Thank you. We will study the case and i'll post the results here.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 18 Oct 2013

Andrew, I appreciate the time taken here.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 18 Oct 2013

When the script is calculated on the bar close (IOG Off) - it takes the current bar's open value and forms the order price. The order is “sent” on the next bar open.

If you want to send an order with the open price of the current bar then you need to turn on IOG, once the strategy is calculated on bar's opening tick you can assign this opening price to your order and send the order on the next tick.
Henry, I believe this to be incorrect. Why would we ever want to place an order at the open of the last bar? There's no world that this makes sense in... I did tests in TS to compare and sure enough.. for once they had it right. Also while referencing the Easy Language Essentials Guide I find this quote on page 95:
http://www.TS.com/~/media/Fil ... tials.ashx

Code: Select all

Open Next Bar
Strategies, by default, calculate on the close of each bar and generate orders into the next bar. However, traders
often want to base their strategy rules on the open of the next new bar. Open Next Bar syntax allows the
calculation engine to delay the strategy calculation until the opening tick of the next bar, and allows you to
reference that opening price in your strategy conditions for orders on that same bar.
Usage Example:
Buy next bar at open next bar - .05 Limit;
(The syntax ‘Open Next Bar’ refers to the opening price of the next bar.)
In this example, we delay the strategy calculation with ‘open next bar’ until the opening tick and then
use that opening price in our order.
Errors like this create extremely optimistic back-tests...
Orders are filled differently in TS backtesting. In TS you can have orders filled between the bars where there was no actual price action. In MultiCharts we do not fill an order without an actual price for it.
In the example above - even if you generate an order with the current bar’s Open limit price– the order will be filled at the same price on the same bar. That will not change the behavior.
This is considered to be the correct and expected behavior.
Incorrect. A gap in price is a gap in price, NOT a gap in orders for price. Just because Multicharts' bars do not have a price illustrated on the chart doesn't mean there is no price at the exchange. Think of a vertical line of price from $1 to $10000000 instead of between calculated blocks/quantities/time periods of this price (bars on a chart).

Please answer this question: When would we as consumers use the OPEN price of the Last Bar? .. think about that one for a second :) Expected behavior or not, that is pretty silly..

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 18 Oct 2013

Incorrect. A gap in price is a gap in price, NOT a gap in orders for price. Just because Multicharts' bars do not have a price illustrated on the chart doesn't mean there is no price at the exchange. Think of a vertical line of price from $1 to $10000000 instead of between calculated blocks/quantities/time periods of this price (bars on a chart).
I am sorry for barging in again, but i may help you with this one too.

What Henry means can be expressed the other way:
  • Backtesting, Bar Magnifier is off, an order is generated to be executed at next bar, next bar OHLC are 100-105-90-95. When BM is off, MC assumes that all prices between O-H-L-C are existing prices, so if an order can be filled within this bar, it will be filled within this bar, but the question in this case is "when". When BM is off, MC follows its price movement assumption, in this case the price is moving from Open to High, then to Low and then to Close of the bar. The key point here is that an order can be filled only within this bar's High and Low (its extremes), it cannot be filled outside the bar and the execution price can be any price between O-H-L-C.
  • Backtesting, Bar Magnifier is on, an order is generated to be executed at next bar, next bar OHLC are 100-105-90-95. Let's assume, BM is set to 1 tick and there are only 11 ticks forming this bar: 100-94-92-90-98-102-105-101-99-97-95. When BM is on, MC can fill orders only at the known prices. In this case there are 15 known prices: OHLC of the main bar (that is luckily has the same OHLC as 11 ticks in our example :-)) and 11 ticks prices. It means that an order cannot be filled at 104, 103, 96 and 93 prices. The goal of such behavior is to exclude possible order executions at unknown prices assuming there were no such prices traded (104, 103, 96, 93) and of course it cannot be filled outside the bar in this case as well.
Please answer this question: When would we as consumers use the OPEN price of the Last Bar? .. think about that one for a second :) Expected behavior or not, that is pretty silly..
Not sure i understand you correctly. Please elaborate.

jstoetz
Posts: 7
Joined: 21 Aug 2013
Has thanked: 2 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby jstoetz » 26 Mar 2014

Any luck with this update (or requested update)?

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 27 Mar 2014

Any luck with this update (or requested update)?
At the moment the feature is not scheduled for any particular MC version.

Rick Webber
Posts: 47
Joined: 04 Jan 2008
Has thanked: 21 times
Been thanked: 3 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Rick Webber » 30 Mar 2014

Damn! Good try guy's but no cigar.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 30 Mar 2014

The simulation of Limit order fills definitely needs improvement. We should also have a simulation of market order fills which would allow the back-tested fill to be X inputted ticks away from the strategy order which would be the only way to back-test market orders.

We've chatted about these before :) They affect all back-tests and would seem to be a high priority for an automated platform... As it is, all back-tests are slightly off which isn't fantastic. There seems to be enough opinions behind this as well.

beck donald
Posts: 196
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 5 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby beck donald » 30 Mar 2014

I have been working on these types of issues for a long time. I still wait for replies to my forwarded files, workspace etc. So I continue my efforts in an attempt to develop a work-a-round.


This has uncovered a whole pile of stuff.

1. Write a simple strategy with an input for X and Y.
Buy Next Bar at X Limit
Sell Next Bar at Y Limit
2. Create a 5 minute chart, 10 point chart, 100 tick chart and 100 change chart all on the same instrument. I will use Euro future as an example.
3. Select 2 levels that over the screen view have been hit many times. I am selecting 1.3750 and 1.3755.
4. Snap 2 horizontal lines on each chart at those exact prices.
5. Apply strategy with those levels selected to each chart.
6. Try various configurations of IOG on/off and magnifier on or off.
7. Look for signals that hit the lines and don't.
8. Run Playback and do the same thing.
9. Run it receiving live market data and trade it live or demo acct your choice.
10. Try changing the code to something on the bar that would be as easy to identify as a price level. Example use the high of the bar to replace a level. I can not get a limit order to be placed using the high of the previous bar as the value. Nor can I use the low.

11. Sorry forgot to add open a fresh chart with the same number of bars available to the strategy and compare to the above.

Gather all the information.

While I am still running my tests on Ver 3 just released,
I so far see that there is a big difference in results based on bar type. That to my eyes, minute charts seem to be the best. I am guessing that is because you can't (should not need to ) magnify the other data types in extended mode.

For my trading method, if the historic backtested and forward tested results are not the same as they would have been had I traded it live (market conditions excluded) I can not see the value in doing all the work in the first place. Can anyone please tell me how it could help if not accurate?


OR maybe I am doing it all wrong and it does work, I just have coded it wrong. If that is the case, please provide the code and example so I can verify it working.

Thanks

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 01 Apr 2014

I have been working on these types of issues for a long time. I still wait for replies to my forwarded files, workspace etc. So I continue my efforts in an attempt to develop a work-a-round.
Are you referring to the Extended Backtesting issue?
1. Write a simple strategy with an input for X and Y.
Buy Next Bar at X Limit
Sell Next Bar at Y Limit
2. Create a 5 minute chart, 10 point chart, 100 tick chart and 100 change chart all on the same instrument. I will use Euro future as an example.
3. Select 2 levels that over the screen view have been hit many times. I am selecting 1.3750 and 1.3755.
4. Snap 2 horizontal lines on each chart at those exact prices.
5. Apply strategy with those levels selected to each chart.
6. Try various configurations of IOG on/off and magnifier on or off.
7. Look for signals that hit the lines and don't.
8. Run Playback and do the same thing.
9. Run it receiving live market data and trade it live or demo acct your choice.
10. Try changing the code to something on the bar that would be as easy to identify as a price level. Example use the high of the bar to replace a level. I can not get a limit order to be placed using the high of the previous bar as the value. Nor can I use the low.

11. Sorry forgot to add open a fresh chart with the same number of bars available to the strategy and compare to the above.

Gather all the information.

While I am still running my tests on Ver 3 just released,
I so far see that there is a big difference in results based on bar type. That to my eyes, minute charts seem to be the best. I am guessing that is because you can't (should not need to ) magnify the other data types in extended mode.
Please come to our live chat during working hours (6:30 am – 2:45 pm EST) to demonstrate it, let our operators connect to your computer remotely in order to study the issue.

beck donald
Posts: 196
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 5 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby beck donald » 01 Apr 2014

Andrew,

I do not know which of the issues I have reported result in this particular result / behaviour
I will try and get the time together to get to chat with everything setup in advance.

Also I have discovered that on 64 rel 3, if you have a time chart, magnify the data and then turn on IOG, it crashes..everytime.

Thank you,
DB

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 02 Apr 2014

Also I have discovered that on 64 rel 3, if you have a time chart, magnify the data and then turn on IOG, it crashes..everytime.
Doesn't seem to be the case on my end:
Image
Image
Image

Could you provide us with following files?
1. The workspace to reproduce the situation.
2. Export of used symbols (without data) from QuoteManager in .qmd archive: https://www.multicharts.com/trading-sof ... rting_Data
3. The exported scripts with all dependant functions that are used on the workspace: https://www.multicharts.com/trading-sof ... ng_Studies
4. MultiCharts Logs: https://www.multicharts.com/trading-sof ... harts_Logs
5. Step-by-step instruction how to reproduce the issue.
6. The screenshot demonstrating the issue.

beck donald
Posts: 196
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 5 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby beck donald » 03 Apr 2014

As it relates to this issue.

I thought I would comment on what you presented. It is more pronounced when in extended mode. You can have the data streams visually present and the signal will still be at a price that does not exist.

Here is an picture of a point chart using bid and ask data and has both present in the chart.

Regards,
Don
FLOATING PRICE.png
(39.1 KiB) Downloaded 8663 times

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 04 Apr 2014

I thought I would comment on what you presented. It is more pronounced when in extended mode.
Sorry, you did not mention this before :-)
Also I have discovered that on 64 rel 3, if you have a time chart, magnify the data and then turn on IOG, it crashes..everytime.
Still looks good:
Image
You can have the data streams visually present and the signal will still be at a price that does not exist.
When extended mode is used, orders are executed at asks and bids, not at base data series, so orders can be executed outside of base data series bars because the was such ask or bid price.

beck donald
Posts: 196
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 5 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby beck donald » 04 Apr 2014

Yes...

I will try again


Example

BID 100

ASK 101

SIGNAL 104

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 04 Apr 2014

Example

BID 100

ASK 101

SIGNAL 104
Could you provide us with following files?
1. The workspace to reproduce the situation.
2. Export of used symbols (without data) from QuoteManager in .qmd archive: https://www.multicharts.com/trading-sof ... rting_Data
3. The exported scripts with all dependant functions that are used on the workspace: https://www.multicharts.com/trading-sof ... ng_Studies
4. Number of bar/bars, their date and time where the issue takes place.

beck donald
Posts: 196
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 5 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby beck donald » 04 Apr 2014

All of this was sent to Dave weeks ago.

No reply

thutch
Posts: 52
Joined: 16 Sep 2011
Has thanked: 16 times
Been thanked: 10 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby thutch » 05 Apr 2014

I would like to comment on this discussion from a real-life markets perspective (as opposed to intended code behaviour). I too widely use limit orders for the subsequent bar's order (usually based on the current bar's Close-1 tick, if going long).

In live markets, if a limit order is traded through (i.e. last bar's Close was 100, I have a limit order to go long at 99, and the bar low is 98), then the exchange will match the trade at the limit price. Guaranteed.

I understand that in backtesting, the bar in which the order resides may not include that price, e.g. a gap may mean the bar high is 98, but that doesn't matter. The fill IMHO should be recorded at 99 as that is what it would have traded at live. Not the 98 bar high.

The last thing a backtester wants is fills that are too good vs. live trading.

I have voted for this "feature request", and think it is an important one.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 05 Apr 2014

I would like to comment on this discussion from a real-life markets perspective (as opposed to intended code behaviour). I too widely use limit orders for the subsequent bar's order (usually based on the current bar's Close-1 tick, if going long).

In live markets, if a limit order is traded through (i.e. last bar's Close was 100, I have a limit order to go long at 99, and the bar low is 98), then the exchange will match the trade at the limit price. Guaranteed.

I understand that in backtesting, the bar in which the order resides may not include that price, e.g. a gap may mean the bar high is 98, but that doesn't matter. The fill IMHO should be recorded at 99 as that is what it would have traded at live. Not the 98 bar high.

The last thing a backtester wants is fills that are too good vs. live trading.

I have voted for this "feature request", and think it is an important one.
Exactly what I've been trying to explain in several threads like this one.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 07 Apr 2014

All of this was sent to Dave weeks ago.

No reply
I have checked that: David responded to you on Tuesday, February 18, 2014 7:05 PM (our local time).
Hello Don,

I apologize for the delay in responding. The engineers have analyzed the behavior that you reported. You are using Extended Backtesting mode which means that your orders are filled at Ask and Bid prices which can be far from current Trade price. It is normal behavior. You may want to disable Extended Backtesting mode.
If you have any further questions, please do not hesitate to contact MultiCharts.
Best Regards,
Dave Masalov
I also found the following screenshot demonstrating how our engieners tested your setup on our end:
Image

From the screenshot we can see the orders are filled at asks and bids when extended mode is used. Please provide us with a new set of requested files if you still have the problem. The issue has not been confirmed yet.

beck donald
Posts: 196
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 5 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby beck donald » 07 Apr 2014

Andrew,

My last attempt on this issue. It is quite frustrating to point out, that which to me is clear, but apparently I am lacking the ability to communicate it clearly.

Buy Signal 104

Ask is 101

Trade is 100.50

Bid is 100

Sell Signal 95


There is no price data at the price of the signal. It was not offered at, never traded at those prices.

Thank you,
Don

All of this was sent to Dave weeks ago.

No reply
I have checked that: David responded to you on Tuesday, February 18, 2014 7:05 PM (our local time).
Hello Don,

I apologize for the delay in responding. The engineers have analyzed the behavior that you reported. You are using Extended Backtesting mode which means that your orders are filled at Ask and Bid prices which can be far from current Trade price. It is normal behavior. You may want to disable Extended Backtesting mode.
If you have any further questions, please do not hesitate to contact MultiCharts.
Best Regards,
Dave Masalov
I also found the following screenshot demonstrating how our engieners tested your setup on our end:
Image

From the screenshot we can see the orders are filled at asks and bids when extended mode is used. Please provide us with a new set of requested files if you still have the problem. The issue has not been confirmed yet.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 07 Apr 2014

Andrew,

My last attempt on this issue. It is quite frustrating to point out, that which to me is clear, but apparently I am lacking the ability to communicate it clearly.

Buy Signal 104

Ask is 101

Trade is 100.50

Bid is 100

Sell Signal 95


There is no price data at the price of the signal. It was not offered at, never traded at those prices.

Thank you,
Don
We do not have any files demonstrating the situation. Please provide us with following files those demonstrate the problem you described:
1. The workspace to reproduce the situation.
2. Export of used symbols (without data) from QuoteManager in .qmd archive: https://www.multicharts.com/trading-sof ... rting_Data
3. The exported scripts with all dependant functions that are used on the workspace: https://www.multicharts.com/trading-sof ... ng_Studies
4. Number of bar/bars, their date and time where the issue takes place.
5. The screenshot demonstrating the issue.

beck donald
Posts: 196
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 5 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby beck donald » 07 Apr 2014

Andrew,

I will have to put this off. I need to find that which has been sent already.To the best of my understanding, I sent everything requested to Dave. He confirmed receipt and said the issue was being looked at. I believe his request was everything your asking for.

As a suggestion. If MultiCharts made it possible for a customer to log into a computer at MC, so we could show the issues on the canned indis, strategies, software, setup etc. Show the problem and be done with it. I have spent way to much time on this 1 issue to just present it.
I have other issues behind this one. Each on its own a significant problem.

I can promise you, it is not unique to my setup.

Although I know this is not the intent, from a customers perspective, it begins to feel like I need to prove the problem exists. That those reviewing the information, is to find fault with the request rather than the software. Again, I know this could not possibly be the intent, but how it feels to get across a problem.

Some users have no experience and therefore what they may present might have the need to be questioned. It maybe for them, they need to be told to plug in the computer and turn on the monitor. There are those however with a lot of experience and while it is possible for them to overlook the obvious, it is not as likely. In my case, my first support person in the field of financial software was Bill Cruz, so I have been at this awhile and it would be great to move past the obvious stuff like telling me using bid and ask "could be higher or lower than a trade price. Bottom line is Extended backtesting especially with non-time charts has a problem in it.

Thank you,
Don

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 07 Apr 2014

Andrew,

I will have to put this off. I need to find that which has been sent already.To the best of my understanding, I sent everything requested to Dave. He confirmed receipt and said the issue was being looked at. I believe his request was everything your asking for.

As a suggestion. If MultiCharts made it possible for a customer to log into a computer at MC, so we could show the issues on the canned indis, strategies, software, setup etc. Show the problem and be done with it. I have spent way to much time on this 1 issue to just present it.
I have other issues behind this one. Each on its own a significant problem.

I can promise you, it is not unique to my setup.

Although I know this is not the intent, from a customers perspective, it begins to feel like I need to prove the problem exists. That those reviewing the information, is to find fault with the request rather than the software. Again, I know this could not possibly be the intent, but how it feels to get across a problem.

Some users have no experience and therefore what they may present might have the need to be questioned. It maybe for them, they need to be told to plug in the computer and turn on the monitor. There are those however with a lot of experience and while it is possible for them to overlook the obvious, it is not as likely. In my case, my first support person in the field of financial software was Bill Cruz, so I have been at this awhile and it would be great to move past the obvious stuff like telling me using bid and ask "could be higher or lower than a trade price. Bottom line is Extended backtesting especially with non-time charts has a problem in it.

Thank you,
Don
Don, an issue cannot be fixed if it is not demonstrated/reproduced/studied. We haven't received any similar reports. All the files you had sent us were studied and engineers confirmed there is no problem. If you would like us to help you with the problem, please come to our live chat to demonstrate it and let us collect all required information ourselves.

beck donald
Posts: 196
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 5 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby beck donald » 07 Apr 2014

I am moving this back to the NET thread. It is happening with both versions and I have a longer thread. "Floating Fills"

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 22 May 2014

"Fill Limit Order when trade price goes beyond limit price" still doesn't work at all with Point bars (mostly where I see the issue). Wondering if a fix is in the making?

These back-testing flaws are what really hurts this platform imo.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 23 May 2014

"Fill Limit Order when trade price goes beyond limit price" still doesn't work at all with Point bars (mostly where I see the issue). Wondering if a fix is in the making?

These back-testing flaws are what really hurts this platform imo.
Please describe in details what exactly is not correct with the assumptions for point-based charts.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 23 May 2014

The issues have been posted in this thread and a few others many months ago.

This selection fills the back-tested order on the limit order price + the inputted "Fill Limit Order when trade price goes beyond limit price" price. This occurs most with Point bars and I'm assuming it has to do with the order not being able to fill on the 1 tick gab between the Point bars. Limit orders do not move.. nor should we ever get a back-test with price improvement (there's more issues with that as well that have been posted)

The "Fill Limit Order when trade price goes beyond limit price" selection shouldn't MOVE the orders to the inputted tick amount... its just to confirm that price moved that far.

Load up a 1 Point bar strategy with a profit target of 1 tick. The profit targets will be back-testing a 2 tick profit target.. even though in real time, they'll be 1 tick.

I could go on with the other many issues, but this is the most important to me.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 27 May 2014

MAtricks,

The orders are filled at a price + 1 point not because of the assumption bug, but because this is the open price of next bar, and this price satisfies order execution criteria (equal or better for limit order).

Image

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 27 May 2014

Andrew, a back-test should never be optimistic enough to give us price improvement. In this case, its a definitely flaw which makes back-testing on Point Bars unrealistic. The markets don't care whether there's a 1 tick gap between our Point bars or not. It fills us between those prices every time.

It would be great to get this fixed :)

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 27 May 2014

MAtricks,

Let's say your code generates 2 orders:
  • buy limit @ 1800.00;
  • sell limit @ 1800.50;
The open of next 1 point bar is 1800.25. Please describe how do you expect the assumption to work.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 27 May 2014

Either of these prices. Nothing else. (I'll back this up in a later post)
  • buy limit @ 1800.00;
  • sell limit @ 1800.50;
But to be more precise, where was our hypothetical price before opening at 1800.25?

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 28 May 2014

But to be more precise, where was our hypothetical price before opening at 1800.25?
Thank you, MAtricks. Hypothetical price before opening at 1800.25 would be 1800.00 (close of previous bar).
What about the following case?
  • sell limit @ 1800.00;
  • buy limit @ 1800.50;

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 28 May 2014

These would be marketable limit orders and would fill at the market price. So if price was 1800.25, our orders would still fill at these prices:
sell limit @ 1800.00;
buy limit @ 1800.50;

User avatar
Smoky
Posts: 413
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 67 times
Been thanked: 105 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Smoky » 28 May 2014

The only way to have perfect baktest ,is when MC will use ASK and BID historical Tick and will play historical datas to your stategy ;) May be in few weeks with 9.0 :)

I've done, I think that MC engineers can also

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 28 May 2014

I agree, but this is an error that should be resolved... The price improvement shouldn't be there. Back-tested Limit Fills should be at Limit Prices- always.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 28 May 2014

These would be marketable limit orders and would fill at the market price. So if price was 1800.25, our orders would still fill at these prices:
sell limit @ 1800.00;
buy limit @ 1800.50;
I agree, but this is an error that should be resolved... The price improvement shouldn't be there. Back-tested Limit Fills should be at Limit Prices- always.
MAtricks, i cannot agree it is an error. Limit orders are always orders to be filled at price or better. If you want them to work different way for backtesting to have worse backtesting results, it is a feature request, not an issue of the software.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 28 May 2014

I'm sorry, but it is an error. Turn off this:

Image

which is *supposed to assume a less optimistic fill* and our error goes away.


Yes, Limit orders are at price or better, but no developer I know of has ever assumed price improvement on their limit orders. That's ridiculous to have EVERY order improved.. this creates an incorrect back-test and is an error... especially while pointing out why it happens (see above picture of the broken feature which causes this)

I'm simply showing MC that this feature does not work correctly. It has nothing to do with a feature request. When turning on this feature which is supposed to ensure that price traded through it N ticks, it instead fills the back-tested order at the N ticks (which is in no way helpful or realistic). That is an error.

Replicating real world fills on each back-tested order should be one of the highest priorities to a trading platform. Limit orders should be filled at the Limit price and only when price trades N ticks through that price. Market orders should be filled at the market price less N ticks for an inputted spread.

10 months and we're still debating this... call it whatever we want to call it, but it needs to be fixed so consumers can trust our favorite trading platform.
Attachments
Limit_orders.png
(7.97 KiB) Downloaded 9038 times
Last edited by MAtricks on 28 May 2014, edited 1 time in total.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 28 May 2014

A limit order can be filled at a better price, if this better price is the first available price right after that limit order is generated. Please leave us such feature request if you would like a different behavior.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby MAtricks » 28 May 2014

The incorrect fill is caused by this feature:

Image

Once turned off, this magical price improvement goes away.

On top of that, a limit order price is very very rarely filled at a better price. This feature is assuming all orders are filled with price improvement. No one would agree that this is something they desire within their back-testing.
Replicating real world fills on each back-tested order should be one of the highest priorities to a trading platform. Limit orders should be filled at the Limit price and only when price trades N ticks through that price. Market orders should be filled at the market price less N ticks for an inputted spread.

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

Re: "Fill Limit Order when trade price goes beyond limit pri

Postby Andrew MultiCharts » 28 May 2014

Orders are filled according to their criteria and on OHLC data on chart in backtesting. If it is buy limit @ 1800.50 and the open of the next bar is 1800.25, the order is filled at 1800.25, because it is a limit order and the first available price at open of next bar satisfies the order execution criteria. If you don't want it to get filled at 1800.25, you can use buy stop @ 1800.50, the order should not be executed at any price lower than 1800.50.

Extended backtesting mode may help you with this, since it allows the orders to be executed not at prices of the main data series, but on additional asks and bids.

Backtesting assumptions for limit orders work as expected.

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

Re: "Fill Limit Order when trade price goes beyond limit pri  [SOLVED]

Postby Andrew MultiCharts » 12 Sep 2014

The behavior of the feature "limit order assumption (when price goes beyond X points) for backtesting" will be improved in future version of MultiCharts. Please keep track of the following feature requests:


Return to “MultiCharts”