• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Programatically scan for top X stocks by volume

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.
    Last edited by cookwp; 05-14-2015, 01:26 PM. Reason: Answered my own question

    #2
    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.pdf
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      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


        #4
        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.htm
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cociahange, Today, 03:53 AM
        0 responses
        1 view
        0 likes
        Last Post cociahange  
        Started by dukeoferl, Today, 03:26 AM
        0 responses
        1 view
        0 likes
        Last Post dukeoferl  
        Started by Titelluvifa, Today, 02:49 AM
        0 responses
        2 views
        0 likes
        Last Post Titelluvifa  
        Started by rehagen, Today, 01:44 AM
        0 responses
        2 views
        0 likes
        Last Post rehagen
        by rehagen
         
        Started by bouncetherubble, Yesterday, 07:33 PM
        0 responses
        7 views
        0 likes
        Last Post bouncetherubble  
        Working...
        X