NexusFi: Find Your Edge


Home Menu

 





How to use volume in your trading


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one cunparis with 187 posts (146 thanks)
    2. looks_two josh with 38 posts (49 thanks)
    3. looks_3 RJay with 34 posts (15 thanks)
    4. looks_4 Silvester17 with 29 posts (24 thanks)
      Best Posters
    1. looks_one Fat Tails with 1.5 thanks per post
    2. looks_two josh with 1.3 thanks per post
    3. looks_3 cunparis with 0.8 thanks per post
    4. looks_4 Silvester17 with 0.8 thanks per post
    1. trending_up 406,114 views
    2. thumb_up 485 thanks given
    3. group 157 followers
    1. forum 677 posts
    2. attach_file 202 attachments




 
Search this Thread

How to use volume in your trading

  #381 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731


cunparis View Post
I read that too. But I already have Ninja & Tradestation and I hesitate to add Investor RT & IQFeed......
Ninja really needs to improve on this. I heard for NT 7.0 the bid ask isn't usable, I don't remember the details but it's disappointing. This is actually one of the only reasons I keep tradestation..

There is a thread on the Ninjatrader forums about problems people are having with the DTNIQ datafeed: connection lost, Ninjatrader freezing, etc. So going to DTNIQ is not the greatest idea right now.

I am not sure what you mean about bid/ask data in Ninjatrader 7. All of the GOMCD indicators work fine.

Indicators that use Level 2 data from OnMarketDepth() store the data in lists. In NT6.5 you can insert rows into a list without having previously explicitly created those rows. In NT7, if you try to insert a row into a position number higher than the row.Count (the number of rows in the list), or if you try to read data from such a row, you will get a runtime error.

Adding a simple one shot routine to create the required number of rows solves the problem. I posted a code sample:

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #382 (permalink)
 
cunparis's Avatar
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
Posts: 2,565 since Jun 2009
Thanks Given: 1,162
Thanks Received: 2,093


Zondor View Post
There is a thread on the Ninjatrader forums about problems people are having with the DTNIQ datafeed: connection lost, Ninjatrader freezing, etc. So going to DTNIQ is not the greatest idea right now.

I am not sure what you mean about bid/ask data in Ninjatrader 7. All of the GOMCD indicators work fine.

Indicators that use Level 2 data from OnMarketDepth() store the data in lists. In NT6.5 you can insert rows into a list without having previously explicitly created those rows. In NT7, if you try to insert a row into a position number higher than the row.Count (the number of rows in the list), or if you try to read data from such a row, you will get a runtime error.

Adding a simple one shot routine to create the required number of rows solves the problem. I posted a code sample:

From what I see in Fulcrum Trader's youtube videos, he is using Investor RT for charting and Ninja for trade exectuions & the DOM. This is exactly what I do with Tradestation. Tradestation sucks for executions, I've ran some automated trading on both and I get 2-3 ticks slippage on tradestation and on Ninja I get zero. This is trading CL during liquid hours using stop market orders. So I have no confidence in tradestation. I love the ininja dom and will only execute trades with ninja. So if investor RT crashes or anything else, you can just restart it and backfill the historical CD data that was missing. With GOM CD, I do not believe this is possible.

With NT 7, I'm not sure you can use historical bid/ask data and backfill it. If this is not correct I'd love to know because that would remove any advantage of investor RT. I will ask in the GOM thread.

Follow me on Twitter Started this thread Reply With Quote
  #383 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731



cunparis View Post
With NT 7, I'm not sure you can use historical bid/ask data and backfill it. If this is not correct I'd love to know because that would remove any advantage of investor RT. I will ask in the GOM thread.

You cannot recover historical bid ask data from a data provider but you can record it locally. Then you will have it available for future use.

To record bid ask data you need to have the GomRecorderIndicator running, with the Write Data parameter set to true. You also need to have previously set up a folder called GomFolder in which the data will be stored, and a Windows Environment Variable (an OS setting) containing the path to the GomFolder.

You need to have a separate GomRecorder running for each instrument for which you wish to record bid ask data.

The GomRecorder Indicator writes the bid ask data to a file in the GomFolder, and the other Gom indicators, which are subclasses of GomRecorder, use it to recover the data from the GomFolder. (Since the other indicators are subclasses of the GomRecorder they also allow you to record the data by setting their Write Data parameter to True, without having to run a separate instance of GomRecorder.)

So, for those time periods when you are connected to a data feed and meet the other conditions above, you will have historical bid ask data. There is a thread explaining this on the Ninjatrader forums, search for GOMCD. I think the thread is called Buy/Sell volume.

It's a little awkward but once it is set up, it works very well.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #384 (permalink)
 
cunparis's Avatar
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
Posts: 2,565 since Jun 2009
Thanks Given: 1,162
Thanks Received: 2,093


Zondor View Post
It's a little awkward but once it is set up, it works very well.

Mine keeps having problems recording, I'll reread the directions and try again. frustrating as heck when it doesn't record properly and for $x per month i prefer to avoid the hassle!

Follow me on Twitter Started this thread Reply With Quote
  #385 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

A few days ago I posted an OnMarketDepth() module modified to work with Ninatrader 7. Please note the correction below. There was one line where I was mistakenly casting e.price as an integer. That causes a lot of problems for instruments whose prices have digits after the decimal points so please don't do it, Putting that in there was a mistake. Sorry for any inconvenience.

Took me a while to notice it because I was doing all my testing on an instrument that actually does have integer pricing.



Zondor View Post
T


//=============================================================================================
//These Lists need to have been declared as variables in the variables region:
//private List<LadderRow> askRows = new List<LadderRow>();
//private List<LadderRow> bidRows = new List<LadderRow>();


protected override void OnMarketDepth(MarketDepthEventArgs e)
{
// try, catch will handle any runtime errors, preventing the program from crashing
try{ // this { is the start of the area that is being monitored for errors
// there may be runtime errors when this starts up in NT7
{

List<LadderRow> rows = null;

// Checks to see if the Market Data is of the Ask type
if (e.MarketDataType == MarketDataType.Ask)
rows = askRows;

// Checks to see if the Market Data is of the Bid type
else if (e.MarketDataType == MarketDataType.Bid)
rows = bidRows;

if (rows == null)
return;

#if NT7 // This switch will prevent the bracketed code from being compiled in NT6.5.
// In NT7, MUST explcitly create list rows before inserting into them, to prevent runtime error
{ // Could also have used the Add method but this is more fun.
if(rows.Count<5) //Create as many rows as you will need for your Level II data. I don't think you can get more than 20 rows of Level 2 data, so 22 rows should be enough.
{ int idx =0;
for (idx = 0; idx < 22/2; idx++)
{ //insert placeholder objects of type LadderRowrows into the list
askRows.Insert(idx, new LadderRow((int)0,(int) 0, ""));
bidRows.Insert(idx, new LadderRow((int)0,(int) 0, ""));
}
}
}
#endif
// In NT7, insertion will fail if there is not already an empty row to insert into


// Checks to see if the action taken by the Ask data was an insertion into the ladder
if (e.Operation == Operation.Insert)
{
//there was a mistake in the next line. The casting of e.price as an integer
//is a mistake that will cause a lot of problems

// was: rows.Insert(e.Position, new LadderRow((int)e.Price,(int) e.Volume, e.MarketMaker));
// should be
rows.Insert(e.Position, new LadderRow(e.Price,e.Volume, e.MarketMaker));
Print("Rowcount, DOM_Bands7 = "+rows.Count);
}
/* Checks to see if the action taken by the Ask data was a removal of itself from the ladder
Note: Due to the multi threaded architecture of the NT core, race conditions could occur
-> check if e.Position is within valid range */
else if (e.Operation == Operation.Remove && e.Position < rows.Count)
rows.RemoveAt(e.Position);

/* Checks to see if the action taken by the Ask data was to update of data already on the ladder
Note: Due to the multi threaded architecture of the NT core, race conditions could occur
-> check if e.Position is within valid range */
else if (e.Operation == Operation.Update && e.Position < rows.Count)
{
rows[e.Position].MarketMaker = e.MarketMaker;
rows[e.Position].Price = e.Price;
rows[e.Position].Volume =(int) e.Volume;
}

// Calling ChartControl.Refresh() will cause the Level II data to update real-time. Adding
// this delay routine will prevent CPU utilization from going through the roof. Setting a
// really high value will effectly delay the update until the next tick arrives which could
// be a really long time is the market is really slow. This may or may not matter to some.




}
} //This is the end of the region that is being monitored for runtime errors
catch (Exception ex){
// Following is what we do if there is an error, sure beats crashing the indicator
Print("Trapped exception in DOM_Bands.OnMarketDepth(): " + ex.Message);
return; //prevents the indicator from crashing
}
}
private class LadderRow //for futures there is no Market Maker, but we can still use this to populate the lists
{
public string MarketMaker; // relevant for stocks only
public double Price;
public int Volume;

public LadderRow(double myPrice, int myVolume, string myMarketMaker)
{
MarketMaker = myMarketMaker;
Price = myPrice;
Volume = myVolume;
}
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==


Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #386 (permalink)
 Prtester 
SE-Asia
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Amp
Trading: ES
Posts: 151 since Jun 2009
Thanks Given: 66
Thanks Received: 124


Zondor View Post
A few days ago I posted an OnMarketDepth() module modified to work with Ninatrader 7. Please note the correction below. There was one line where I was mistakenly casting e.price as an integer. That causes a lot of problems for instruments whose prices have digits after the decimal points so please don't do it, Putting that in there was a mistake. Sorry for any inconvenience.

Took me a while to notice it because I was doing all my testing on an instrument that actually does have integer pricing.

I found a simple example in the NT Forum (Lot less Code) and this was the one I used in 6.5, but for NT7 caused some performance problems.

Attached Files
Elite Membership required to download: DepthReferenceSample.cs
Reply With Quote
  #387 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731


Prtester View Post
I found a simple example in the NT Forum (Lot less Code) and this was the one I used in 6.5, but for NT7 caused some performance problems.


Thanks for that post. I will look into it further and see if I can get it to work in NT7. What kind of performance problems: Does it crash completely? Use too many resources? etc.

The main reason there is less code is that this only accumulates the total depth and does not keep track of what is going on at each level.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #388 (permalink)
 NickA 
London
 
Experience: None
Platform: MC & Ninja mainly
Posts: 135 since Jan 2010
Thanks Given: 5
Thanks Received: 50

Apparently IQfeed (and possibly others) now provide 24 hours historic bid ask data. This makes a huge difference to approaches that rely on vol@bid/ask to guage order flow. It is simply not robust to rely on 24/7 availability of the PC collecting the data. Hopefully we are coming to an age where this sort of analysis can be done much more painlessly. Of course you need tools that can read this and the ability to build a bar tick by tick even from historic data. I hope NT 7.0 doesn't drop the ball on this.

Reply With Quote
  #389 (permalink)
 
cunparis's Avatar
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
Posts: 2,565 since Jun 2009
Thanks Given: 1,162
Thanks Received: 2,093


NickA View Post
Apparently IQfeed (and possibly others) now provide 24 hours historic bid ask data. This makes a huge difference to approaches that rely on vol@bid/ask to guage order flow. It is simply not robust to rely on 24/7 availability of the PC collecting the data. Hopefully we are coming to an age where this sort of analysis can be done much more painlessly. Of course you need tools that can read this and the ability to build a bar tick by tick even from historic data. I hope NT 7.0 doesn't drop the ball on this.

NT7 did drop the ball. Completely. NT7 doesn't store the bid/ask with the data. You can get bid/ask but it's not synchronized with the data.

i'm currently using investor RT for my volume work. If you look at its data format you'll see bid & ask on each line of data. NT doesn't do this and the bid/ask information is lost.

Follow me on Twitter Started this thread Reply With Quote
  #390 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599



cunparis View Post
NT7 doesn't store the bid/ask with the data. You can get bid/ask but it's not synchronized with the data.

Can you point to where you are getting this info, or provide an example?

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on April 21, 2016


© 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