Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Programatically scan for top X stocks by volume
Collapse
X
-
Programatically scan for top X stocks by volume
Thank you, I will try it add multiple instruments and see how it impacts performance calculating a large number of instruments' volumes several times a day. -
Hello cookwp,
Yes, this is possible, but requires that you add each instrument that you would like to check the volume of using the Add() call.
Then each volume can be accessed, and you will need to create a loop that compares the volume and sorts it in a list. Then you would simply look for the first x instruments in the list after it is sorted by volume.
So yes this is possible, but would be involved and may take some advanced coding to accomplish.
Just a heads up, NinjaTrader 8 does give you access to the Hotlists in NinjaScript so making a loop like this is not created. This is mentioned in the NinjaTrader 8 Major Enhancements document which I am linking below.
http://www.ninjatrader.com/downloads...njaTrader8.pdfChelsea B.NinjaTrader Customer Service
-
To get the current daily volume of an instrument when I have a chart of multi instruments, how do I get the DOUBLE value of that instrument's current volume? Do I use the VOLUMES[][] call? And if so, how do I get the value from the DataSeries[] object that is returned?
Comment
-
Hello cookwp,
That is correct, to check the volume of a secondary series use Volumes. (plural)
For example if I have 2 added data series, for a total of 3 including the primary and I want the volume of the current bar of the second data series use:
Print(Volumes[1][0]);
Volumes[dataseries index][bar index]
For the previous value use:
Print(Volumes[1][1]);
For the primary volume on the current bar use:
Print(Volumes[0][0]);
http://www.ninjatrader.com/support/h...t7/volumes.htm
Also, you will want to be sure that you are processing on the correct series using BarsInProgress.
http://www.ninjatrader.com/support/h...inprogress.htmChelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by helpwanted, Today, 03:06 AM
|
1 response
5 views
0 likes
|
Last Post Today, 03:35 AM | ||
Started by Brevo, Today, 01:45 AM
|
0 responses
7 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
242 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
Comment