SellAtStop behavior when the stop price is at the low of the day
Author: DaveAronow
Creation Date: 8/21/2010 2:33 PM
profile picture

DaveAronow

#1
In trying to figure out why WL was showing a futures trade as active but in fact my stop was hit I discovered something which seems weird. If you run the following script on stocks most of the trades are exiting the next day (as you'd expect) but not all of them. With futures it's even stranger, the trades do not appear to exit unless the price is a multiple of 0.25 (no matter what type of contract or tick value). Very very strange! Can someone look into it and let me know what's going on -- I don't see why a SellAtStop with a price of the day's low would fail to execute (yes I realize the script is peeking but it's peeking to demonstrate the issue).

Edit: Note in this case my slippage setting is disabled (no slippage) -- not sure if that seems to matter or not
Edit2: The same seems to apply to Short/Cover, with futures the prices need to be a multiple of 0.25 for it to exit the trade
CODE:
Please log in to see this code.
profile picture

Eugene

#2
Looks like the "tick adjustment problem" meets CQ 156346 (Stop/limit order failures using non-Fidelity data)...
profile picture

Eugene

#3
profile picture

Cone

#4
I'd like to see the data and the Symbol Info Mgr settings uses that produce the 0.25 phenomenon.
profile picture

DaveAronow

#5
I did some more testing and it seems like the 0.25 issue it only occurs with Metastock data. When I run on ASCII data from the same source (Pinnacle) I don't see it at all.

Additionally I discovered that the data coming from the metastock source is not correct -- in terms of the actual values I see things like 98.6900024414063 when the actual price is 98.69. I copied the metastock data to an old PC where I have an old version of the metastock downloader so I could see if the data itself is incorrect but it looks fine. I also tried with data from Premium Data and I see the same thing. Very strange.

For now I am coping by using a round to tick function to correct all prices (or at least make them valid) which resolves the issue of filled trades (in my case I am pretty sure they were not filling because the trading simulation engine was comparing a sell stop price of 98.76 to a low of 98.760000133 and technically the stop price was not hit because of the metastock issue). I'm running 64 bit Windows 7, not sure if that has anything to do with it.

Dave

Edit: Note I am seeing the 0.25 issue with ALL futures when using metastock data, it doesn't matter which contract I use
profile picture

Cone

#6
QUOTE:
I see things like 98.6900024414063 when the actual price is 98.69.
This isn't a problem, it's just a single-precision floating point representation (like Version 4 WL files), where a number is accurately represented only to only 7 or 8 digits, i.e., 98.69000

QUOTE:
Edit: Note I am seeing the 0.25 issue with ALL futures when using metastock data
What provider is the source of that MS data? Could you zip and attach a folder of that data to a support ticket so I can take a look, please?
profile picture

DaveAronow

#7
I opened a ticket (19783) and attached the data. For me it appears to happen with data from both Pinnacle and Premium Data.

I'm kind of torn about what I hope you find -- if you can't recreate it that means it's something on my machine, but at least then there's likely a pretty simple fix. If you can then it's more systemic but at least I didn't screw something up royally.

As for the floating point precision issue I don't see it when I use ASCII data from the same sources. I also didn't see it when I loaded the metastock data into "The Downloader" from Metastock, but maybe they correct for it?

For now I am working around it by using ASCII versions of the same data.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).