Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
How can I count EVERY contract sold with the same timestamp in millisec in Multichart
I'm trying to undestand what kind of values it is possible to obtain with Multichart and easylanguage regarding every processed trade. I spent some hours researching online about just some guidelines or samples that can help me to find out details about this matter with no luck.
For example, I would like to count every single contract sold with the same timestamps with a milliseconds precision. I have a really good datafeed ( or I hope it is good: DTN IQFEED ) and I would like to process those data in order to make a custom indicator so if anyone can point me in the right direction in order to achive this it would be really appreciated.
Thanks in advance,
David
Can you help answer these questions from other members on NexusFi?
from your outline it's not clear if you want to store the data and if so how. If you are actually looking to store every tick (versus just counting it) you will likely have to handle a lot of data, which would most likely rule out the usage of arrays within MC, but would force you to use something outside of MC.
Can you provide an example of what you are trying to do exactly, as this might help in pointing you in the right direction?
thanks for the reply. Save and collect huge amount of data it is not my scope also I wouldn't like to use something outside MC. My interest is to make a real time indicator that can plot the summation of almost every single contract sold at the same time with milliseconds precision (so with the same timestamps). For sure, after the understanding of the coding logic behind this, I will "play" with the data to see if it is better to filter them in a proper way and make some test to see what it can be achived and how those data can be useful.
With such an indicator my goal is :
1) Get notice of very Big Players entering the market with a lot of contract in a fraction of time
2) I would like to test some datafeed to compare the quality of datas and to see who's missing something.
Any link or guidelines will be appreciated as I really surfed a lot the web but I did not find any literature or easylanguage samples to understand how to access to those kind of data.
for realtime use build your charts from second data i.e. use a 60 second chart instead of a 1 minute chart for example. The reserved word DateTime will give you access to the exact time of each tick then as it comes in.
I was able to access to the milliseconds data. Thanks for you help !! Now I have to play a little bit with the data in order to decide how to display and/or filter it and try to recognize a "buy" from a " sell" ...
The logic you would need for such a task is fairly straight forward. I did something similar a while back using NinjaTrader though it was for a different purpose.
1. Create a variable called CurrentMillisecond and one called LastMillisecond.
2. Create a variable called LargeVolume
3. For each millisecond change in your computers internal clock you print the aggregate volume of the variable LargeVolume (as long as this aggregate total is > a predefined threshold) So if you have a single millisecond timestamp and an aggregate total volume > 1,000 then you may classify this as a significant volume event and take note of it, but other milliseconds may have 10 or 100 contracts and you may wish to omit them from your indicator.
4. You will just need run your LargeVolume variable like this. LargeVolume = LargeVolume + Volume (Where volume is the MultiCharts syntax for the current transacted volume) I don't know the specific syntax here, but you just keep adding to your variable until the millisecond time stamp changes. Once your clock reference to Now.Millsecond <> CurrentMillsecond variable you would print the LargeVolume variable and then set it back to 0 and start counting from the next batch of transactions.
5. You will need to do this on a tick by tick basis. So you would need to go with a time independent level 1 feed that has the full level of granularity of each individual order. Once you start aggregating things to a bar based time frame the whole idea will fail.
Anyway, this is very easy to figure out the logic for. So you'll have no issues coding it..... but I do not believe that your premise (Identifying large orders) will work the way you expect. You will inadvertently also catch a lot of false positives as well. If 500 retail traders all put a stop at price = 2000, then they will join a market order queue and just wait. Now if on the opposite side there are also 500 limit orders at price = 2000 (potentially made up of hundreds of traders as well) then when the price hits 2000 during that exact millisecond you will see a huge fury of transactions hit as the market order queue and limit order queue matches traders. This may appear to be a large single power player, but in this example it is just the two queues hitting on the same price filling all traders involved. How can you tell if this huge 500 contract transaction was a large iceburg from a single party broken up into multiple pieces or lots of little guys hitting stops? You can't tell the difference. So for this reason, I would say that your premise is generally flawed for it's intended purpose. The only way around this issue that I see is to specifically filter for only orders that come after the first price level change event. The first instant that a price level gets hit, the exchange will clear both queues until there is no more action. It is only then, that this type of logic (Hunting for large orders) would ever be applicable. So you would have to burden yourself to filter all the action associated with price level changes out and only look at incremental orders that hit after the 2 queues touch for the first time. This would be more of a pain in the ass to program and you would likely lose 75% of all the action..... But anything that is left would in all likelyhood be legit.
I am not sure what value this would have for your trading, but it would be a pain to develop logic for.
Anyway, hope this gives you some ideas.
Best of luck!
Ian
In the analytical world there is no such thing as art, there is only the science you know and the science you don't know. Characterizing the science you don't know as "art" is a fools game.