| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #545 | ||
![]() | Re: Volume Splitter | ||
| |
|
| | #546 | ||
![]() | Re: Volume Splitter | ||
| |
|
| | #547 | ||
![]() | Re: Volume Splitter Instead of comparing against the current inside market, you should keep track of the market side of each price using an associative array (dictionary, map, hash, index or whatever your programming language calls it). This will always correctly determine the side of a trade independent of the how the feed reports the data. Here is what an implementation in C# would look like: //enumeration for market side public enum eSide { None, Bid, Ask, } //static dictionary taht keeps track of market side at price private static readonly Dictionary<decimal, eSide> _marketSideByPrice = new Dictionary<decimal, eSide>>(); private eSide GetTradeSide(decimal bidPrice, decimal askPrice, decimal tradePrice) { //set side at bid if (_marketSideByPrice.Conta insKey(bidPrice)) _marketSideByPrice[bidPrice] = eSide.Bid; else _marketSideByPrice.Add(bi dPrice, eSide.Bid); //set side at ask if (_marketSideByPrice.Conta insKey(askPrice)) _marketSideByPrice[askPrice] = eSide.Ask; else _marketSideByPrice.Add(as kPrice, eSide.Ask); //get side at trade price eSide tradeSide = marketSideByPrice[tradePrice]; return tradeSide; } | ||
| |
|
| The Following User Says Thank You to AgeKay For This Useful Post: | ||
paolfili (03-31-2010) | ||
| | #548 | ||
![]() | Re: Volume Splitter Quote:
are you programming to their API directly? Is their API C#? | ||
| |
|
| | #549 | ||
![]() | Re: Volume Splitter Quote:
| ||
| |
|
| | #550 | ||
![]() | Re: Volume Splitter Quote:
Let's say first trade is at 150.05 on the bid and we've never been higher. Then the bid goes 150.06 but there are no trades. and now you get an update message with bid 150.07 ask 150.08 and a trade at 150.06. we wouldn't have 150.06 in our dictionary? If the bid/ask changes were sent independently of the trades then everything would make a lot more sense. Please forgive me if I'm missing something really simple. | ||
| |
|
| | #551 | ||
![]() | Re: Volume Splitter Quote:
In many platforms where your indicator is only updated on trades and you call some API to get the inside bid/ask... in some cases (tradestation, for example) that means you might want to forget about trying to assign bid/ask to trades because it's using snapshotted bid/ask data which are stale. In some platforms, that can be accurate as it sounds like Agekay mentioned he was using one like that in a previous post. | ||
| |
|
| | #552 | ||
![]() | Re: Volume Splitter Quote:
The platform can send the bid/ask changes independently but only if the datafeed supports it. I am under the impression that IQFeed sends them together. | ||
| |
|
![]() |
| Tags |
| eot, volume splitter |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Retest on Lower Volume with Volume Gradient | walterw | Technical Analysis | 3 | 04-16-2009 12:10 AM |
| NYSE Up Volume($UVOL)/Down Volume ($DVOL) Comparison | MC | Market Internals | 23 | 02-09-2009 09:18 AM |