NexusFi: Find Your Edge


Home Menu

 





Design a DayTrader Scalping Order Flow Indicator


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one hyperscalper with 136 posts (239 thanks)
    2. looks_two Chof with 22 posts (12 thanks)
    3. looks_3 Connor with 16 posts (8 thanks)
    4. looks_4 justtrader with 14 posts (8 thanks)
      Best Posters
    1. looks_one bobwest with 2 thanks per post
    2. looks_two hyperscalper with 1.8 thanks per post
    3. looks_3 SpeculatorSeth with 1 thanks per post
    4. looks_4 Chof with 0.5 thanks per post
    1. trending_up 46,088 views
    2. thumb_up 328 thanks given
    3. group 55 followers
    1. forum 248 posts
    2. attach_file 80 attachments




 
Search this Thread

Design a DayTrader Scalping Order Flow Indicator

  #41 (permalink)
 SpeculatorSeth   is a Vendor
 
Posts: 780 since Apr 2016
Thanks Given: 22
Thanks Received: 1,018


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 NexusFi?
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
Better Renko Gaps
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #42 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
Posts: 314 since Apr 2020
Thanks Given: 15
Thanks Received: 522


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
  #43 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,527 since Oct 2009
Thanks Given: 4,171
Thanks Received: 6,018



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
  #44 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
Posts: 314 since Apr 2020
Thanks Given: 15
Thanks Received: 522


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
  #45 (permalink)
 SpeculatorSeth   is a Vendor
 
Posts: 780 since Apr 2016
Thanks Given: 22
Thanks Received: 1,018


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
Thanked by:
  #46 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
Posts: 314 since Apr 2020
Thanks Given: 15
Thanks Received: 522


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
  #47 (permalink)
 
justtrader's Avatar
 justtrader 
San Francisco, CA
 
Experience: Intermediate
Platform: Ninja Trader, TOS
Trading: es, rty, cl, gc, nq, ym
Posts: 182 since May 2011
Thanks Given: 104
Thanks Received: 173


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
Thanked by:
  #48 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
Posts: 314 since Apr 2020
Thanks Given: 15
Thanks Received: 522


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
Thanked by:
  #49 (permalink)
 
justtrader's Avatar
 justtrader 
San Francisco, CA
 
Experience: Intermediate
Platform: Ninja Trader, TOS
Trading: es, rty, cl, gc, nq, ym
Posts: 182 since May 2011
Thanks Given: 104
Thanks Received: 173


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
  #50 (permalink)
 hyperscalper 
boise idaho
 
Experience: Advanced
Platform: NinjaTrader C# Custom
Broker: NinjaTrader LeeLoo Rithmic
Trading: Nasdaq Futures NQ/MNQ
Posts: 314 since Apr 2020
Thanks Given: 15
Thanks Received: 522



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
Thanked by:




Last Updated on January 26, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts