Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pair trading / Spread trading

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

    Pair trading / Spread trading

    Hi,

    1) I'm wondering if you are able to in Ninja Script to Pair Trading / Spread Trading, where you have (2) data feeds of 2 different stocks and are able to say long one and short the other at the same time?


    2) NTMarketPosition("") ---> okay say I have a trade station chart on. The symbol is INTC. In order to find out the marketposition of INTC I type NTMarketPosition(""), but say that while I'm on the INTC chart I want to find out the market position of CSCO, can I type NTMarketPosition("CSCO");

    Thanks

    #2
    1) Yes, please see SampleMultiInstrument strategy and docs related: http://www.ninjatrader-support.com/H...struments.html
    2) No. But you could code your own TS EL function to do that, please check out how NTMarketPosition function is implemented in TS EL and how the symbol is referenced. Note: This is beyond what we can support, you would need to try on your own.

    Comment


      #3
      1) NT 6.5 due out shortly is better equipped to handle this since we will introduce an OnMarketData() method that is fired for every change in market data for the "pair" you are tracking.
      RayNinjaTrader Customer Service

      Comment


        #4
        excellent,

        also are you able to in ninja script run multiple strategies?

        Thanks

        Comment


          #5
          - you can run multiple NS strategies on different instruments concurrently
          - you can not run a NS strategy within a NS strategy

          Comment


            #6
            I am trying to convert a pair trading/spread strategy that I built in WealthLab. I am having a bit of a hard time, starting with the basic of how do I get the price of the second stock, then proceed to use the bar close price of both to go through my calculations. Can you please direct me. As I understand NT7, which is what im using, has some special features for this...can you please explain all.
            Thx in advance!

            Comment


              #7
              Hi nightriderx,

              I have implemented something very similar here - http://www.ninjatrader.com/support/f...d=1&linkid=293

              Using a multi-series script - http://www.ninjatrader-support.com/H...ameInstruments
              TimNinjaTrader Customer Service

              Comment


                #8
                The first link does not seem to be working

                Comment


                  #9
                  artov,

                  Thanks. It has likely been moved to a different location.

                  Believe it is this one: http://www.ninjatrader.com/support/f...d=4&linkid=363
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Mindset, 04-21-2026, 06:46 AM
                  0 responses
                  105 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by M4ndoo, 04-20-2026, 05:21 PM
                  0 responses
                  145 views
                  0 likes
                  Last Post M4ndoo
                  by M4ndoo
                   
                  Started by M4ndoo, 04-19-2026, 05:54 PM
                  0 responses
                  71 views
                  0 likes
                  Last Post M4ndoo
                  by M4ndoo
                   
                  Started by cmoran13, 04-16-2026, 01:02 PM
                  0 responses
                  125 views
                  0 likes
                  Last Post cmoran13  
                  Started by PaulMohn, 04-10-2026, 11:11 AM
                  0 responses
                  79 views
                  0 likes
                  Last Post PaulMohn  
                  Working...
                  X