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!
See more
See less

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 kevinenergy, 02-17-2023, 12:42 PM
        115 responses
        2,699 views
        1 like
        Last Post kevinenergy  
        Started by prdecast, Today, 06:07 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Christopher_R, Today, 12:29 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by chartchart, 05-19-2021, 04:14 PM
        3 responses
        577 views
        1 like
        Last Post NinjaTrader_Gaby  
        Started by bsbisme, Yesterday, 02:08 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X