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)
The code I just posted will work if you build a strategy against it. I can show you the level 2 bits too, but we'd probably need to get together on discord to debug it a bit.
- SpeculatorSeth
Can you help answer these questions from other members on NexusFi?
What does that mean "if you build a strategy against it"?
I just like to see ALL of the code involved; it's just me...
[EDIT] I didn't see a built in OrderFlowDelta; where's that found? Pardon my
apparent ignorance but there are a lot of features of the platform I don't use at all.
This interest is all appreciated; but these facilities do not replicate what I coded...
I take an unconventional approach; and that's not necessarily good; unless you
need something unconventional to achieve your goals !!
However, to the extent that all of this may have inspired a select few to delve into
C# and write some truly "creative" (i.e. not "canned") Indicators to achieve their
Dreams or, more specifically to focus on a very specific Theory/Hypothesis about
the market; then I'll say "my job is done" LOL
I got nuthin to sell anybody; but if you have questions about this little tutorial
example; feel free to chime in. As they say, "There are no Stupid questions" if
your goal is to learn and grow your abilities as a Trader through some real
coding expertise using NinjaTrader 8; a truly remarkable platform for those
who know how to write innovative code...
Oi you're right. OrderFlowDelta is my own indicator that I just named too similar to NinjaTrader's. What it should probably be using is OrderFlowCumulativeDelta. It does look like you could use BuySellVolume, but note that sell volume is buys+sells so that the two bars are always visible against each other. So you'd have to compensate back the other way. Or just steal the OnMarketData code from that
But again that's the whole thing. What OrderFlowCumulativeDelta does is not that complicated. Clearly there's enough information in this thread to make one yourself. But you're not supposed to duplicate that stuff to let people get around having to buy the full license for the order flow stuff.
Oi you're right. OrderFlowDelta is my own indicator that I just named too similar to NinjaTrader's. What it should probably be using is OrderFlowCumulativeDelta. It does look like you could use BuySellVolume, but note that sell volume is buys+sells so that the two bars are always visible against each other. So you'd have to compensate back the other way. Or just steal the OnMarketData code from that
But again that's the whole thing. What OrderFlowCumulativeDelta does is not that complicated. Clearly there's enough information in this thread to make one yourself. But you're not supposed to duplicate that stuff to let people get around having to buy the full license for the order flow stuff.
Seth, you say "But you're not supposed to duplicate that stuff to let people
get around having to buy the full license for the order flow stuff." REALLY?
I don't buy that NinjaTrader can stop traders
from writing ANY code they wish, and even Selling it, if they wish...
Sure, nobody wants to "poke the Bear" but I hardly think they would retaliate against
anybody who wrote useful code... If you sign some sort of "vendor agreement" with
them; then maybe you're legally constrained... ??
When deciding whether to even do this Thread; I hesitated, knowing that there's very
little payback from an exercise like this, and free code. But I still believe in a place
called "Hope" (as President Clinton once said, LOL) and I'd like in some small way,
to inspire somebody; so I can say I made a contribution, even though apparently
nobody gets the point of it
LOL Honestly, it was fun; and I'm done.
To quote Deckard in Blade Runner "I was done when I walked in, and I'm twice as done now!"
LOL, just kidding
[EDITORIAL CORRECTION] Instead of "done", Deckard used the word "quit" ...
[EDIT] To answer your query; YES, it's often a great way to make something
"dynamic" by comparing incoming events with some "slower" moving average;
and when you see a 3x or 5x or 10x event, then you'll flag it !!! Yes, I do a lot
of that stuff, maybe too much of it !! What I'm trying to measure is often so
difficult; for example, "instantaneous" Ratios of Inside BID size against inside
ASK/OFFER size. And I mean "instantaneous"... This is when Market Makers
approach the market; and those are almost always "significant" events. So the
Ratios of those sizes, relative to "average ratios" is a great way to try and "see"
those events... How much "Fun" are we having ??? LOL
Placing a per-instance User Interface on Indicators is certainly NOT SUPPORTED by
NinjaScript Platform support; but they do always suggest such things. However,
there are a lot of "gotchas" when you try to do that, due to the "multiple cloning",
allocated resource deallocations requirements, which that imposes...? Made no sense
to you???? Good ! Never try to do it... LOL
So completely bypassing those significant issues, is the Best way forward. A simple
parameters file, with an automatic reader; indeed, just the code I provided... is guaranteed
to work, no complications, etc..... YOU HAVE BEEN WARNED. Just kidding...
NinjaTrader has decided to use the WPF format, since that's where Microsoft is moving
for user interfaces. But when you need a Real "dense" Highly Functional User Interface,
you're on your own.
I'll post my WinForms User Interface, which runs a Custom Strategy combining
Analytics with highly Configurable Order Triggering, so you can see what a "really
complex" User Interface means.
BY THE WAY, so Horrified were Microsoft users that they were "ditching" the WinForms
in favor of WPF, that WPF was forced to have a "WinForms Host Control" within which
WinForms can be implemented within an "outer shell" of WPF.
When you have several Dozens of Interactive Controls you need to EASILY implement,
there is no substitute for the tried and true WinForms which is still "supported" via
this WPF "hosting" control.
But, believe me, it's a nightmare, and that's why they DO NOT Support such code.
I'll attach a picture of my User Interface, just to reinforce my point here... You're
looking only at 1 of 7 Tabbed control panels.... So, yeah..... crazy. But YOU CAN'T
DO STUFF LIKE THAT with WPF; Just Sayin'.... LOL
[EDIT2] But I'd like to emphasize that this kind of stuff is so DIFFICULT, due to
what I call the "weird" lifecycle of an Indicator or Strategy instance. Often it's best
to start it running and NEVER try to adjust it, since anything really complex is
likely to fail; due to the "cloning" and "reflection" method NT8 uses for parameters
and NinjaScript like instances..... don't argue with them; just try to bypass the issues.
[EDIT3] THERE IS NOTHING, repeat NOTHING as powerful as NinjaTrader 8, and they
have a monopoly on that platform; I need it; and there's nowhere else for me to go,
so I have to live with the way they've engineered it. It's amazing; but nothing's
absolutely perfect
hyperxtrading
Wow. That is a super-impressive panel.
I thought that mine was complicated, where I modified Ninjas Chart Trader. Hope NijaTrader do not get mad at me.
TWYS NWYT(Price Advertises Opportunity; Time Regulates it; Volume Measures its Success/Failure ---- Dalton)
Wow. That is a super-impressive panel.
I thought that mine was complicated, where I modified Ninjas Chart Trader. Hope NijaTrader do not get mad at me.
HA HA !!! Well, honestly I haven't worked with WPF and all that XML based stuff.
But with WinForms, you can make a VERY DENSE and highly interactive UI; no question
about it, with detailed Pixel level placements, etc..... as you probably know.
It is true that WPF does have a WinForms Host Control; but I didn't use it; and
probably should have.......
You clearly did a great job, and it's more in line with what NinjaTrader recommends, of
course, but I'd be surprised if they support it !! LOL
ONE BIG ISSUE I have yet to get up the sheer energy to resolve this: My ridiculously
complex and non-restartable Strategy simply sub-classes the Strategy superclass.
This is a LINGERING issue on my To-Do list because:
That is deadly, since even if you check on Strategy parameters again, plus a number of
other unspecified operations on THAT CHART; you will receive a TERMINATE status
and you are Phukked.....
The only Real Solution to this, is to subclass NinjaTrader's "AddOn" class; which is the basis for their Chart Trader (if I'm not mistaken)...
This solution would NOT be subject to the arbitrary resets which can come from the
Standard approach where the Strategy is attached to a particular chart.
This "AddOn" based code would then IDEALLY, present a super-class which was similar
enough to Strategy; so that my Strategy code could mostly just be "plugged in"...
IN SUMMARY: Any sufficiently complex Strategy and, in particular one which MUST HAVE
RELIABLE RECOVERABILITY, such as an Unattended BOT type Strategy..... simply
does not have the Run Time stability, and all of this tracks back to the "cloning" and
"reflection" and all of that krap; which TRIVIAL Strategies done through NinjaScript
standard techniques, must be able to tolerate.
A significant piece of code which MUST be reliable; simply can't rely on subclassing
Strategy; so in my humble opinion, it would have to subclass this AddOn hierarchy,
and present to subclasses generally what a Strategy subclass currently exposes...
IF THAT MADE ANY SENSE TO YOU; THEN YOU ARE CLEARLY WELL-INFORMED lol
BUT LET ME BE CLEAR; I THINK YOU'RE OK; since I believe it's the case that Chart Trader
descends from the AddOn hierarchy; and for good reason... Congrats on the work !!
HA HA !!! Well, honestly I haven't worked with WPF and all that XML based stuff.
But with WinForms, you can make a VERY DENSE and highly interactive UI; no question
about it, with detailed Pixel level placements, etc..... as you probably know.
It is true that WPF does have a WinForms Host Control; but I didn't use it; and
probably should have.......
You clearly did a great job, and it's more in line with what NinjaTrader recommends, of
course, but I'd be surprised if they support it !! LOL
ONE BIG ISSUE I have yet to get up the sheer energy to resolve this: My ridiculously
complex and non-restartable Strategy simply sub-classes the Strategy superclass.
This is a LINGERING issue on my To-Do list because:
That is deadly, since even if you check on Strategy parameters again, plus a number of
other unspecified operations on THAT CHART; you will receive a TERMINATE status
and you are Phukked.....
The only Real Solution to this, is to subclass NinjaTrader's "AddOn" class; which is the basis for their Chart Trader (if I'm not mistaken)...
This solution would NOT be subject to the arbitrary resets which can come from the
Standard approach where the Strategy is attached to a particular chart.
This "AddOn" based code would then IDEALLY, present a super-class which was similar
enough to Strategy; so that my Strategy code could mostly just be "plugged in"...
IN SUMMARY: Any sufficiently complex Strategy and, in particular one which MUST HAVE
RELIABLE RECOVERABILITY, such as an Unattended BOT type Strategy..... simply
does not have the Run Time stability, and all of this tracks back to the "cloning" and
"reflection" and all of that krap; which TRIVIAL Strategies done through NinjaScript
standard techniques, must be able to tolerate.
A significant piece of code which MUST be reliable; simply can't rely on subclassing
Strategy; so in my humble opinion, it would have to subclass this AddOn hierarchy,
and present to subclasses generally what a Strategy subclass currently exposes...
IF THAT MADE ANY SENSE TO YOU; THEN YOU ARE CLEARLY WELL-INFORMED lol
BUT LET ME BE CLEAR; I THINK YOU'RE OK; since I believe it's the case that Chart Trader
descends from the AddOn hierarchy; and for good reason... Congrats on the work !!
hyperxtrading
If I can free up some time I will explore the possibility of using this type of chart trader to act like Ninja's strategy analyzer with all the needed coded to auto trade --- Hopefully after I find the holly grail.
I will explore your code from this forum to see if I can get some close to reliable signals. As some one suggested earlier, perhaps finding a way to dynamically set the BIGLOT_MINIMUM and other parameters might help a lot.
Thank you for helping out.
JT
TWYS NWYT(Price Advertises Opportunity; Time Regulates it; Volume Measures its Success/Failure ---- Dalton)
If I can free up some time I will explore the possibility of using this type of chart trader to act like Ninja's strategy analyzer with all the needed coded to auto trade --- Hopefully after I find the holly grail.
I will explore your code from this forum to see if I can get some close to reliable signals. As some one suggested earlier, perhaps finding a way to dynamically set the BIGLOT_MINIMUM and other parameters might help a lot.
Thank you for helping out.
JT
Hey, I've actually been running the code; and it's important to go back to a fuller
understanding of the WHY we're designing 1) Big Lot filtering, and 2) an adjustable
Time Evaluation window on the integrator.
As the code stands now; as simple as it is, it's quite useful. However, my next step
would be to put a couple of Fast/Slow moving averagers on the OUTPUT of the
Volume Integrator, to better measure the "acceleration" of Big Lot Integration at
the tops and the bottoms.
Now, if you can define some sort of Triggering mechanism; which I'd implement as
a Socket comms from Trade Flow, into your Chart Trader enhanced Order processor...
now we're talking some fast-enough triggering.
Actually, funny enough the first thing I coded up in Ninja was an Indicator which
functioned as a "capture and forward" data pipeline, using a Socket, into some
Analytics code in Java which was already existing...
If you don't know how to do that... well, I might provide some help; but my
Time is also limited !!
WHEN YOU CAN "MARRY" ANALYTICS TRIGGERING, WITH EXECUTION, then
you're talking some money-making... Just sayin'
Oh by the way, that Socket stuff would also fall into the "sorry, we don't support that"
if you ever asked platform support for support... You're ON YOUR OWN ! LOL
[EDIT] in my enthusiasm, I almost posted an asynchronous double buffered socket
sender as an example; but then I came to my proper senses ! LOL Don't want
any TMI Information Overload happening in this forum !!!