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 Kaiviti57, Today, 04:13 AM
        0 responses
        1 view
        0 likes
        Last Post Kaiviti57  
        Started by Cross161, Yesterday, 10:33 PM
        0 responses
        10 views
        0 likes
        Last Post Cross161  
        Started by neilzep, Yesterday, 08:55 PM
        0 responses
        8 views
        0 likes
        Last Post neilzep
        by neilzep
         
        Started by javier.filgueira, Yesterday, 03:29 PM
        3 responses
        11 views
        0 likes
        Last Post javier.filgueira  
        Started by Da vinci, Yesterday, 03:15 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X