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

Multi-instrument arbitrage strategy

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

    Multi-instrument arbitrage strategy

    Please could you kindly guide me how to develop simple multi-instrument arbitrage strategy in the strategy builder? I.e. 2 legs - long and short. I require immediate short opening in leg 2 if long in leg 1 is opened.

    All positions are to close if the strategy PnL reaches certain amount.

    If similar topic was already raised, I appreciate the link to read it...

    Thanx in advance.

    #2
    Hello Aporshnev,

    Thank you for your reply.

    To clarify, you are looking for an example of a strategy that will run on two separate instruments, and take the opposite position in the second instrument when a position is opened in the first, is that correct? Arbitrage can refer to a few different things so I just want to clarify.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the message. I`m looking for the sample of a logic how to realize in strategy builder the principal which you correctly described above.
      Another words - should my inputs be an instruments? Or I should set different series..? Any other way to make it work..? I will be grateful if you give me just right direction how to structure this logic using the strategy builder tools.

      Comment


        #4
        Hello Aporshnev,

        Thank you for your reply.

        The sort of logic you're describing would not be able to be built in the Strategy Builder. Strategy Builder strategies can only submit orders to the primary data series - orders cannot be routed to a secondary series. You would need to manually code a strategy that submits to two different data series, as you'd need to do here.

        I will put together a quick example strategy and post that for you as soon as I've completed the example.

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thanks. Look forward to.

          Comment


            #6
            Hi Aporshnev, thanks for your patience.

            I attached a simple example that will enter long on the primary instrument and short on the secondary. I tested using an AAPL chart, with MSFT as my secondary data series. Its all about using the correct BarsInProgressIndexin the order entry method in use (in this case EnterLong()). This number goes up from 0 for each data series that is added to the script. Please also review the multi time frame and instrument guide on our help guide site:

            https://ninjatrader.com/support/help...nstruments.htm

            Please let me know if I can assist any further.
            Attached Files
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by usazencortex, Today, 12:43 AM
            0 responses
            5 views
            0 likes
            Last Post usazencortex  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,266 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X