Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Routing orders to diff. brokers and other suggs.

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

    Routing orders to diff. brokers and other suggs.

    Hi,

    I've had some more time to play with Ninja and would like to suggest a couple of things and ask some questions.

    - Is it possible to route an order to a specific broker (is it even possible to connect to two brokers at the same time). For example, I want to route trades with share size > 1000 to broker A, share size <= 100 to broker B.

    - The backtesting and optimizing framework is great but I want to be able to easily run a strategy against 50 stocks (for example). I asked this question before and have looked at the multi-instrument stuff. The problem is, I want to backtest against multiple stocks individually (to get individual results) and then run the live strategy against some subset of those. I don't want to have 2 strategies, one for backtesting individual stocks and one for running multi-instrument live trading. I want them to be the same (from a framework perspective it's much cleaner to have each instrument be it's own strategy instead of me having to have a bunch of logic in the strategy to constantly test and switch on the instrument - multi-instrument strategies are great when a strategy really works against those instruments together)

    A great solution to this would be to give the ability to fill the strategy tab with strategies on a instrument folder (similar to how you can backtest against a folder in the strategy analyzer). Then you need to be able to manage 'groups' of strategies somehow (start/stop them as a group, delete them, etc.)

    - suggestion: the strategy tab should be the main 'owner' of strategies including ones created in a chart. I don't want to stop a strategy just because I accidentally closed a chart and I want to be able to view a chart of any strategy that is running.

    - What is the practical limit to the number of instruments that can run in real-time on minute bars using IB (for example). If a strategy is using minute bars does Ninja request minute bars from IB or does Ninja collate tick data to create minute bars on the fly? Obviously if Ninja is getting tick data it's going to severely limit the number of instruments that can be watched simultaneously. (IB might have a max num instruments that can be watched anyway)

    Thanks.

    #2
    >> (is it even possible to connect to two brokers at the same time).
    yes

    >> Is it possible to route an order to a specific broker
    yes

    >> A great solution to this would be to give the ability to fill the strategy tab with strategies on a instrument folder
    Thanks for your suggestion. We'll add it to the list of future considerations.

    >> the strategy tab should be the main 'owner' of strategies including ones created in a chart.
    Thanks for your suggestion. We'll add it to the list of future considerations.

    >> What is the practical limit to the number of instruments that can run in real-time on minute bars using IB (for example)
    You would need to play and test it out.

    Please contact IB for limitations on their end.

    Comment


      #3
      Thanks for the response.

      Can you clarify one point:

      >> Is it possible to route an order to a specific broker
      yes

      Is that, within a strategy? So within a single strategy I can route orders to different brokers dynamically? (just want to make sure.)

      Comment


        #4
        You can do that by:
        - opening a new account connection (for a different broker technology) OR
        - setting up a new instrument for a different exchange and trade it on the same connection

        Would not work dynamically though.

        Comment


          #5
          So the answer to my actual question is NO.

          You cannot, in a strategy, using NinjaScript (C#), route an order to multiple brokers dynamically.

          like:

          OnBar()
          {
          numSharesToPurchase = dollarAmount / sharePrice;
          if(numSharesToPurchase > 5000)
          Buy( BrokerA, numSharesToPurchase )
          else
          Buy( BrokerB, numSharesToPurchase )
          }


          Now that I think about it, I guess you can work around this by breaking the same strategy into 2, they would both buy/sell on the same conditions but one would only actually buy/sell on shares above 5000 while the other does shares below 5000.

          Thanks.

          Comment


            #6
            That is correct. At this time, a strategy only knows one Account at run time.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by wzgy0920, 02-22-2024, 01:11 AM
            5 responses
            32 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, Yesterday, 09:53 PM
            2 responses
            49 views
            0 likes
            Last Post wzgy0920  
            Started by Kensonprib, 04-28-2021, 10:11 AM
            5 responses
            191 views
            0 likes
            Last Post Hasadafa  
            Started by GussJ, 03-04-2020, 03:11 PM
            11 responses
            3,230 views
            0 likes
            Last Post xiinteractive  
            Started by andrewtrades, Today, 04:57 PM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X