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

Trading a lot stocks via single strategy

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

    Trading a lot stocks via single strategy

    Hello,

    I want to develop a strategy using which I want to trade several stocks. It would need to monitor hundreds of stock symbols and then dynamically place open/close orders for some of them.

    The signals for these stocks will be derived from outside the strategy (via reading an external file/database etc), but the strategy will need to manage the aspect of just placing the orders.

    Is this possible to do? I tried looking up in the forum, not sure if I found something that answered my query fully.

    I appreciate your input.

    Thanks.

    #2
    I'd imagine it's possible to run an external program or parse data from a file and then have it execute an ATM strategy based on the result. NinjaScript is implemented in C#, so most if not all of those native features should work. The way you would actually implement this depends on how you are planning to determine your entry and exit signals.

    Comment


      #3
      Am planning on getting the symbol and entry/exit prices by periodically reading a file from the file system. And then simply place the buy or sell orders from the strategy. Per my understanding of Ninjatrader, the difficulty I would be facing is having to add series for so many symbols in the script or opening up so many charts. I might be wrong, as am new to Ninjatrader.

      Comment


        #4
        Hello RuthB,

        Thank you for your note.

        Dynamic adding of data series is not supported in NinjaScript, so you would need to manually code each data series the strategy will use into your strategy. If you're looking at hundreds of stocks at once, the strategy will need to load all of those data series and process each tick that comes in at once. As you are new to NinjaTrader and NinjaScript, I would advise starting with something small, maybe a handful of stocks, and make sure you can get that working first before tackling a strategy that uses hundreds of data series.

        Apex128's suggestion of creating an add on that would submit an ATM strategy may be a bit more feasible, but would require more advanced programming skill.

        Also, with many data providers, there is a limit to how many instruments you can receive data for simultaneously. I would advise that you check with your data provider to ensure you can receive data for the number of instruments you would need simultaneously.

        As you are new to NinjaTrader, if you would like to take on learning NinjaScript, we have a fully documented help guide which will help you get started. You will find language references to all of the methods and functions you will be using. You will also see a tutorial section which will help you create your first strategy and get you started with some of these concepts. It's worth noting that while we in the support department cannot create, modify, or debug a strategy for you, we can certainly assist by answering specific questions and providing resources and examples.

        A link to our Help Guide can be found below:



        I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:



        You will find Reference Samples online as well as some Tips and Tricks for both indicators and strategies:

        Click here to see our NinjaScript Reference Samples: https://ninjatrader.com/support/help...ce_samples.htm
        Click here to see our NinjaScript Tips: https://ninjatrader.com/support/help...en-us/tips.htm

        These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

        There is also a growing library of user submitted custom indicators (100+) that can be downloaded from the NinjaTrader Ecosystem User App Share page:



        Please let us know if we may be of further assistance to you.

        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thanks, Apex128 and Kate. I will check these resources out.

          Is there a sample to the approach that Apex128 is suggesting available for reference? Like kicking off a strategy dynamically from an Addon for a symbol to place the orders.
          Would help cut down my research time drastically.

          Comment


            #6
            Hello RuthB,

            Thank you for your reply.

            An example of submitting an ATM strategy from an addon can be found in AddOn Framework NinjaScript Basic that can be downloaded from the help guide.
            http://ninjatrader.com/support/helpG...t_overview.htm

            My colleague Chelsea also posted a much simpler example.
            http://ninjatrader.com/support/forum...555#post515555

            Also, see the help guide on StartAtmStrategy().
            http://ninjatrader.com/support/helpG...tmstrategy.htm

            However, keep in mind that you also cannot dynamically add data series to an AddOn, either, so you would still have the issue of needing to program in all those series.

            It may simply not be feasible to have one script deal with that many series - at best it would have a very large performance impact.

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Thanks, Kate. I am not looking to add data series. All I want to do is place predetermined orders (symbol/entry/exit prices) coming from another orders generator outside NT. While exploring the above documentation found 'Account' class. I think this class can help me solve my problems. Let me play around.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Tim-c, Today, 03:54 AM
              0 responses
              3 views
              0 likes
              Last Post Tim-c
              by Tim-c
               
              Started by FrancisMorro, Today, 03:24 AM
              0 responses
              3 views
              0 likes
              Last Post FrancisMorro  
              Started by Segwin, 05-07-2018, 02:15 PM
              10 responses
              1,772 views
              0 likes
              Last Post Leafcutter  
              Started by Rapine Heihei, 04-23-2024, 07:51 PM
              2 responses
              31 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by Shansen, 08-30-2019, 10:18 PM
              24 responses
              945 views
              0 likes
              Last Post spwizard  
              Working...
              X