Design a DayTrader Scalping Order Flow Indicator - futures io
futures io



Design a DayTrader Scalping Order Flow Indicator


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one hyperscalper with 111 posts (156 thanks)
    2. looks_two Chof with 22 posts (6 thanks)
    3. looks_3 justtrader with 14 posts (3 thanks)
    4. looks_4 TWDsje with 13 posts (9 thanks)
      Best Posters
    1. looks_one bobwest with 1.5 thanks per post
    2. looks_two hyperscalper with 1.4 thanks per post
    3. looks_3 TWDsje with 0.7 thanks per post
    4. looks_4 Chof with 0.3 thanks per post
    1. trending_up 11,640 views
    2. thumb_up 196 thanks given
    3. group 35 followers
    1. forum 193 posts
    2. attach_file 63 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Design a DayTrader Scalping Order Flow Indicator

(login for full post details)
  #41 (permalink)
 TWDsje   is a Vendor
 
 
Posts: 706 since Apr 2016
Thanks: 20 given, 818 received


hyperscalper View Post
I REALLY WISH you would be willing to do a Strategy Tester compatible version of
the Trade Flow, and make it available.... PLEASE... I'd run the Strategy Tester
against it, out of curiosity !

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
Reply With Quote

Can you help answer these questions
from other members on futures io?
Harmonic Patterns Indicatorsto be corrected
EasyLanguage Programming
Google Keyword Search Alerts
Traders Hideout
Chart Comparer
NinjaTrader
one chart to another
NinjaTrader
Does anyone have the code for Anchored Vwap to use in Qu …
Traders Hideout
 
 
(login for full post details)
  #42 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
 
Posts: 247 since Apr 2020
Thanks: 14 given, 328 received


TWDsje View Post
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.

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.

Thanks !
hyperxtrading

Started this thread Reply With Quote
 
(login for full post details)
  #43 (permalink)
 trendisyourfriend 
Legendary Market Wizard
Quebec
 
Experience: Intermediate
Platform: NinjaTrader wt Rancho Dinero's profiling tools
Broker: AMP/CQG
Trading: ES, NQ, YM
 
trendisyourfriend's Avatar
 
Posts: 4,142 since Oct 2009
Thanks: 3,820 given, 5,384 received



TWDsje View Post
... However, we can just use the built in OrderFlowDelta. So you get something like this where you add deltas for the new bar and remove deltas for the bar that is leaving the frame.

 
Code
//This namespace holds Indicators in this folder and is required. Do not change it. 
namespace NinjaTrader.NinjaScript.Indicators.SpeculatorSethFree
{
	public class spsMarketOrderImbalance : Indicator
	{
		OrderFlowDelta MyDelta;
        ...
}

This is not recognized by Ninja but you can use the BuySellVolume indicator:
https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?buysellvolume.htm

Reply With Quote
 
(login for full post details)
  #44 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
 
Posts: 247 since Apr 2020
Thanks: 14 given, 328 received


trendisyourfriend View Post
This is not recognized by Ninja but you can use the BuySellVolume indicator:
https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?buysellvolume.htm

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...

hyperxtrading

Started this thread Reply With Quote
 
(login for full post details)
  #45 (permalink)
 TWDsje   is a Vendor
 
 
Posts: 706 since Apr 2016
Thanks: 20 given, 818 received


trendisyourfriend View Post
This is not recognized by Ninja but you can use the BuySellVolume indicator:
https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?buysellvolume.htm

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.

- SpeculatorSeth
Reply With Quote
The following user says Thank You to TWDsje for this post:
 
(login for full post details)
  #46 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
 
Posts: 247 since Apr 2020
Thanks: 14 given, 328 received


TWDsje View Post
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" ...

hyperxtrading

Started this thread Reply With Quote
 
(login for full post details)
  #47 (permalink)
 justtrader 
San Francisco, CA
 
Experience: Intermediate
Platform: Ninja Trader, TOS
Trading: es, rty, cl, gc, nq, ym, dax
 
justtrader's Avatar
 
Posts: 160 since May 2011
Thanks: 95 given, 154 received


hyperscalper View Post
[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)
Reply With Quote
The following user says Thank You to justtrader for this post:
 
(login for full post details)
  #48 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
 
Posts: 247 since Apr 2020
Thanks: 14 given, 328 received


justtrader View Post
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 !!

hyperxtrading

Started this thread Reply With Quote
The following user says Thank You to hyperscalper for this post:
 
(login for full post details)
  #49 (permalink)
 justtrader 
San Francisco, CA
 
Experience: Intermediate
Platform: Ninja Trader, TOS
Trading: es, rty, cl, gc, nq, ym, dax
 
justtrader's Avatar
 
Posts: 160 since May 2011
Thanks: 95 given, 154 received


hyperscalper View Post
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)
Reply With Quote
 
(login for full post details)
  #50 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
 
Posts: 247 since Apr 2020
Thanks: 14 given, 328 received



justtrader View Post
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 !!!

hyperxtrading

Started this thread Reply With Quote
The following user says Thank You to hyperscalper for this post:


futures io Trading Community Traders Hideout > Design a DayTrader Scalping Order Flow Indicator


Last Updated on November 29, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts