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)
COMMENTS ON SIMPLE BIG LOT INTEGRATORS FOR INVENTORY ANALYSIS
Full Inventory Analysis, is a very complex and memory intensive activity, whereby
for example, each Market Maker Buy is matched with a MM Sell from which the two
matching volumes (open Inventory) are taken out of the Price Trade history.
This "matching" is the equivalent of "making the Spread" which Market Maker does
all the time, you'll recall, by always Buying the BID and always Selling the ASK/OFFER
price, thus profiting by the amount of the spread on average.
Following the 80/20 rule, or perhaps the 90/10 rule, and considering the shorter
timeframes involved; THANKFULLY a Full Inventory Analysis, which looks at Risk
factors (how much money is being Lost due to VWAP adversity) is
NOT REALLY WORTHWHILE on these shorter Accumulation / Distribution
timeframes.
This fact greatly SIMPLIFIES our task, which collapses to the much simpler
Integration of Signed Trade Volumes over a recent Window of time; a calculation
which is quite simple to accomplish.
WHAT ARE WE REALLY LOOKING FOR HERE?
OK, let's face that question head on. Intuitively, and in fact, we see that there is
a "flurry" of activity at TOPs and BOTTOMs; often referred to as the "fight" between
Buyers and Sellers. What is happening here?
1) Trade frequency per unit time increases at these prospective Tops and Bottoms, but
that is not particularly informative.
2) DIRECTIONALITY of the signed Trade Volumes increases as Retail players BUY at the
last (wrong) moment, i.e. at the Top; and THE MIX of Trade Volumes SHIFTS to contain
a much higher percentage of BIG LOT trades.
3) the reason for 2) above, is that Market Maker also moves significant SIZE on the
Book, or the DOM, the Market Depth in order to interact with this flurry of Retail
activity PREFERENTIALLY.
4) this is true because Market Maker INTENDS TO CHANGE THE PRICE TREND, and so
wants to SELL to the Retail population, as much as Possible, at as High a price as possible.
(and the opposite at a bottom...)
WE ARE THEREFORE LOOKING FOR an Acceleration of Signed Volume MM Selling Distribution at a
"top" (more Retail Buying in larger lot sizes); and the opposite at a bottom,
an Acceleration of Signed Retail Selling volume, and increases in Big Lot sizes as Retail Sellers accelerate their
Selling at the bottom, enabling MM to "scoop up" Buying volume at as low a Price as possible
before turning the Price trend.
AS A GENERAL SUMMARY, we are looking for an Acceleration in Distribution by MM Selling at Tops,
and an Acceleration in Accumulation by MM at Bottoms; using the Retail population as the
unfortunate "sheep-like" counter-party because, as we've said, the Retail population most
generally Buys when Price rises (especially if a Break Out seems possible); and Sells when
Price falls (especially if a Break Down seems probable).
IT IS THIS ACCELERATION IN "BIG LOT" *RATES* OF ACCUMULATION AND DISTRIBUTION
that we are seeking to characterize by this Indicator.
Naturally, anybody can try to punch holes in this, and it's true that perhaps NO SINGLE INDICATOR
should be relied upon; however, this effect is Universal and in the very nature of trading, so
we will see it nearly everywhere.
[EDIT] So.. IN CASE IT HASN'T BEEN MADE OBVIOUS TO THIS POINT IN TIME...
Market Maker is, in fact, TRADING AGAINST YOU, taking a Position against the
ENTIRE Retail Market, getting Long at Bottoms, and Short at Tops; so she is
your Mortal Enemy, and any clues as to her situation (e.g. Inventory imbalance)
gives you an edge.
FINAL QUESTION: What do you think results in the "Micro Sawtooth" structure of
Price movement? It should be obvious at this point that MM creates these Price
movements in order to take Long/Short positions against the entire Retail Trading
population simultaneously... And if that's not an "Aha!" moment, then what is? LOL
A typical Trader using NinjaTrader 8 may not have created an Indicator. You are
out of luck... but it's not that bad if you take it "one step at a time".
The code I'll be releasing is, first of all, "kind of a hack" since I would not design
this in a single file, I would use Interfaces, I would use refactoring, and a bunch
of other things in multiple files..... and I'd do it in Visual Studio, and I'd
probably generate a DLL, .... BUT let's just not worry about all that now !!!
We have decided to do this all in a single file, which means Classes must be declared
"inline" as so-called "inner classes" and the size of the code file very quickly becomes
huge; even with the relatively basic things we're trying to do...
So I'd recommend that you dust off your existing skills or, if you're not a coder, to
regularly take time to become proficient; and just keep moving forward.
UNLESS YOU CAN IMPLEMENT YOUR OWN INDICATOR IDEAS, YOU'LL ALWAYS
BE AT THE MERCY OF SOMEONE ELSE, so Jump In... the Water's Fine
WHAT ARE THE CONCEPTS WE'RE INTRODUCING THAT WILL BE STRANGE, AND
PROBABLY "UNSUPPORTED" HERE?
NO INTERACTIVE USER INTERFACE for Indicators, means that if we do want to
interact while the Indicator is running, we have to "roll our own". We decided to
use a simple Properties file concept where the text entries on each line have the
form of "key=value"; and we have a periodic reader which will re-read that file
and assign any new values; which are then applied to our running Indicator.
WHY? We want to avoid the weirdness and bugs associated with going back to
the Properties dialog in NinjaTrader 8. Trust me, you don't want to have to deal
with that.....
ALSO WHY? Because the Dynamic range of the market during a session changes very
considerably, and we want (at a minimum) to 1) change the vertical scaling of our
output), and 2) to change the "retention interval" within our Trade Flow Integrator,
and 3) adjust our "Big Lot" minimum threshold as well.....
NinjaTrader support would say that the method being used here is "unsupported", so
don't be surprised; and just don't ask. Ask hackers, perhaps in this forum instead.
Most of you Hackers are "White Hat" hackers... just kidding... LOL
MULTIPLE ASYNCHRONOUS THREADS to implement the Properties file periodic updater.
This updater has a "loop" which executes in a completely independent "thread" of
execution, absolutely "asynchronously" to the Indicator's callbacks to the main
elements OnMarketData and OnBarUpdate, etc... The code Waits for a while,
which can be interrupted early, and then re-reads the Properties file. If you want
to investigate Thread usage like this, it's easy once you understand what's going on...
USING A TEXT EDITOR (recommended Notepad++) which you'll be able to use to
EDIT the Properties text file. When you SAVE the update, then the Indicator's
property reader loop will READ the file again, parse it, and then there's a primitive
callback into the Indicator body, which will enable the Indicator to correctly update
its internal variables. If you screw up your edits, internal exceptions should be
generated; but the system should not crash... Fingers crossed !
MULTIPLE COPIES OF THE INDICATOR presumably on multiple different symbols,
keeping in mind that I'm only focussed on NQ or MNQ contracts, but there isn't
anything inherently different in other symbols, since we're only reading the fairly
standard Time and Sales, but any problems represent an "opportunity" for you
to modify things to suit your needs... A DIFFERENT FILENAME should be used
for Properties on different symbols, or perhaps running on the SAME symbol,
but with DIFFERENT parameters.... keep that in mind.
INITIALIZATION AND DE-INITIALIZATION should not really be required here, since
we no longer need to Stop and Restart the Indicator in order to change its behavior.
NinjaTrader 8 uses what I can only describe as a "very weird" "object cloning" method
of activating Indicators, Strategy's, etc. and YOU DON'T WANT TO KNOW THE
DETAILS cuz they will cause lots of Anxiety !!! The fact that we are not having to
stop and restart the Indicator means we completely side-step those thorny issues,
and TRUST ME, they cause a lot of problems when you're allocating Objects like
we are, and potentially (as you really SHOULD) implementing your Indicator
as a DLL file..... 'Nuff said.
IT WON'T BE LONG before a strictly Alpha/Beta sample will be posted, and then
we'll find all the Bugs. I just wanted to get y'all started; and what we really want
to focus upon is the PREDICTIVE NATURE OF THE SIGNAL we're trying to generate !!!
THE PROPERTIES FILE AS IT IS INITIALLY WRITTEN, however I did change
the MULTIPLIER in the Editor from 1 to 1.5
Note that it is written to the Custom folder at the path you can also see
at the top of the Notepad++ editor screenshot.
THAT IS TO SAY, it would be your personal login Documents path for NinjaTrader
down in the bin then Custom folders.
BEST PRACTICE IS: If you modify the code in the NinjaScript editor and compile; then
it's best to go to the attach Chart(s) and REMOVE the existing indicator (because it
is running the OLD one), APPLY and then ADD the Indicator again (be sure to put in
the desired File Name).
NinjaTrader uses "reflection" and also "object cloning" to retain the state of Indicators,
so best when you make code changes to "quasi-religiously" REMOVE, and then ADD again.
[EDIT] Yes, you're waiting for the code; just let me check it out first; otherwise, I'll
have Egg Yolks on my face, for sure... LOL
OK, JUST SOME FINAL COMMENTS BEFORE BUGS COME ROLLING IN.
Screenshot attached shows 2 instances of TradeFlow with different "retention" intervals.
Typically each Indicator instance is in its own Panel.
But the image shows that if you click "on the data series" (the purple line) then you
can DRAG that onto the Price chart, so you have them overlain, which I personally
find better in seeing the relationships against Price more precisely.
ENJOY !!!
[EDIT] If you had any doubt, you can see how powerfully Retail Players are SELLERS
on Price decline, by viewing the attachment... Yep, most of them are "sheeple" LOL
[EDIT2] Attached some more realtime NQ info, showing Price versus Net Inventory
Trade Flow over 5 minutes expiration window
PERFORMANCE CONCERNS CAN BE MONITORED WITH NT8 FROM
THE NINJASCRIPT OUTPUT WINDOW, right click and select
the NinjaScript Utilization Monitor.
This will display cumulative ongoing Milliseconds relative usage across
ALL Indicators in the system.
Our little Indicator "TradeFlowTutorial" seen in the screenshot is consuming
very little relative CPU; even though it's not really highly optimized, and may
not need to be....
Good question. I have no idea what NinjaTrader engineering has coded...
Yes. 1) size filter is key; and 2) a strict integration time window (with taper)
are a couple of things; including also adjustability of the retention interval
and size filter while the Indicator is running in real time... just a few things.
As I have discussed we are concerned with teasing out "Big Lot Accumulation and
Distribution patterns" and ideally the "acceleration" of those effects at Tops and
Bottoms.
I've laid out the code; but it doesn't make a concerted effort to measure Acceleration
in Accumulation or Distribution more precisely; so that's an enhancement you could
play with.
I'm wide open to hear, or see screenshots comparing our TradeFlowTutorial tool with
existing Indicators, and whether anyone has significant "insights" as to how we
can better hone in on the effects which I've outlined from Theory through to the
very basic implementation we have here...
Believe me, I wouldn't be satisfied with the basic tool outlined above... It's a tutorial
which has "simple" enough code, for the average Trader to follow, while challenging
the "standard approaches" in a few key ways...
LIVE AND LEARN... the process never stops !!
I AM VERY INTERESTED IN YOUR IDEAS AND RESPONSES; i don't really have an
"agenda" here, other than finding "trade signals" which make money... But I do very
much like to have a "Theory" behind, and a "rationale" for, the Indicators I am using,
and preferably know exactly what they are measuring...
The "Big Lot" size threshold is a very interesting thing to fiddle with.
You'd be surprised, when the REALLY BIG LOTS start coming through,
just how much that tends to "nail" a major Top or Bottom
The "retention interval" on the Window, especially when coupled with a
relatively high Big Lot size filter, will cause such an Indicator to "spike"
at these significant turning points.
Consider that you may want the Indicator to stay at ZERO until this "Big Lot stuff"
starts to happen....
[EDIT] Notice in the attached screenshot how the 30 second retention interval
with a 10 Big Lot threshold starts to "spike"...
[EDIT2] REMEMBER... those "spikes" represent Retail Players, and MARKET MAKER
trades AGAINST them... that's the theory anyway...
ISSUES? Sure, there are many when dealing with the Nasdaq futures market,
and its WIDE DYNAMIC RANGE, which is why the ability to TWEAK the parameters
during a Day Trading session is really required.
I HAVE FOUND with my highly custom setup; that Tops and Bottoms in
Accumulation/Distribution of Big Lots is a very good Trigger Signal. Of
course, I have all of that built into an extremely complex Triggering
system which combines a handful of simultaneous additional conditions,
against which my system, which is co-located; can quickly react...
But this simple TradeFlowTutorial Indicator is intended for more "normal"
Traders who want to have some additional confirmation of where Local
Tops and Bottoms may exist, especially if you are a Scalper...
For me, ANALYTICS are the most important thing in the world; but then once they
are "good enough" the ability to MANAGE ORDERS in line with the Analytics
"signals" may also be required, since the sheer speed and frankly the Brutality
of the Nasdaq market, especially at the open, makes Manual trading impossible.
But that's not the Trader for which I've designed that simple Indicator; but it
is something you could consider if you put that code in a Strategy module, rather
than an Indicator; and attempt to "trigger" trades based on that, and a few
other signal variables.
BUT THEREIN IS A "Rabbit Hole" which you should realize requires significant
commitment.... so I don't expect most Traders will want to jump down it !!