Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sample Pair Trading Strategy using Strategy Builder?

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

    Sample Pair Trading Strategy using Strategy Builder?

    I added 2 data series that I want to use
    EURUSD (1min) and GBPUSD (1min)

    Under Strategy Builder's Condition and Action page
    How do I Simultaneously
    Enter Long EUSUD
    Enter Short GBPUSD


    When
    RSI of
    EUSUD
    is <30
    RSI
    of GBPUSD is >70

    I attached the screenshot.





    #2
    Hello johnnybegoode,

    Thanks for your post.

    The Strategy Builder will only send orders to the charts data series.

    To accomplish your goal you would need to unlock your code and work directly in Ninjascript to use the advanced order methods to place orders to different bars in progress.

    Please review https://ninjatrader.com/support/help...nstruments.htm for an understanding of programming multi-series strategies. For the advanced order methods, please see the help guide section here: https://ninjatrader.com/support/help...r_handling.htm

    Comment


      #3
      Does NinjaTrader support trading two different symbols on one chart?

      I asked a programmer to code for me and he could not do it.

      Comment


        #4
        Hello johnnybegoode,

        Thanks for your reply.

        Yes, you can trade each instrument of a multi symbol chart. Please see, "Working with multiple instruments" https://ninjatrader.com/support/help...on_display.htm

        You can trade multiple symbols in a Ninjascript created strategy.
        Last edited by NinjaTrader_PaulH; 11-28-2018, 08:43 AM. Reason: Corrected reply.

        Comment


          #5
          Hello johnnybegoode,

          After further review, I am mistaken in my previous reply and will correct the post.

          Yes, you can trade each instrument of a multi symbol chart. Please see, "Working with multiple instruments" https://ninjatrader.com/support/help...on_display.htm

          Comment


            #6
            Programmer:
            NT can display more than 1 symbol on 1 chart, and you can trade any 1 of those symbols on the chart. But I guess you should ask them how to trade two different symbols at the same time from one strategy scripts.

            Comment


              #7
              Hello johnnybegoode,

              Thanks for your reply.

              Yes, trading multiple symbols can be done through a single ninjascript strategy (not through strategy builder). Please see https://ninjatrader.com/support/help...nstruments.htm


              Comment


                #8
                Question 1 is from my programmer:
                Interesting, I know NT can trade secondary symbol by calling the Add() method, but it's not the chart symbol.

                Did you ask them to trade secondary symbol based on the chart like the attached photo?
                The strategy scripts can trade all chart symbols without calling the Add() method at all???


                Question 2
                Do you have examples of multi-instrument strategy and pair trading strategy?

                Thank you!

                Comment


                  #9
                  Hello johnnybegoode,

                  Thanks for your reply.

                  The screenshot appears to be from NinjaTrader7. If you are using Ninjatrader7 please let us know as my replies to you have been based on NinjaTrader8 as you posted in the NinjaTrader8 strategy development area and your original post shows Ninjatrader8 type screens.

                  Q1. We've discussed trading on the chart with the chart trader and how manually you can trade the instruments on the chart (which cannot be done in NT7). For a Ninjascript strategy, the strategy will use the charts primary data series as its primary data series and to trade any other instrument, the instrument would need to be added to the strategy through the NT8 method AdddataSeries().

                  Q2. The NT7 or NT8 platform has a strategy called SampleMultiInstrument which demonstrates trading on more than one instrument.

                  Comment


                    #10
                    Programmer's reply:
                    OK, use this pic, same question, is possible to use strategy scripts trade all chart symbols without calling the Add() method at all???

                    Comment


                      #11
                      Hello johnnybegoode,

                      "is possible to use strategy scripts trade all chart symbols without calling the Add() method at all???" There are no ninjascript means to accomplish that. For a Ninjascript strategy, the strategy will use the charts primary data series as its primary data series and to trade any other instrument, the instrument would need to be added to the strategy through the NT8 method AdddataSeries().

                      Comment


                        #12
                        Programmer's reply:
                        That's what I told you, it's impossible to trade more than one chart symbol.
                        It can only trade the primary symbol on chart.
                        Now you get the official answer from NinjaTrader.

                        Your SampleMultiInstrument does not work!!!
                        Last edited by johnnybegoode; 12-02-2018, 06:12 PM.

                        Comment


                          #13
                          Hello johnnybegoode,

                          Thanks for your reply.

                          The example SampleMultiInstrument will use a second instrument to calculate the ADX from. I was mistaken that this example shows entering orders on two different instruments as it only uses data from another series to calculate the ADX.

                          I've created a short video example with a simple script that demonstrates filling a strategy order for two instruments in one script: https://Paul-ninjaTrader.tinytake.co...IyM185MzgzOTkz

                          Comment


                            #14
                            Hi Paul, can I backtest multiple instrument strategies on historical data? I created a simple strategy which trades 2 instruments, but it doesn't execute any trades against the 2nd instrument when I do a backtest.

                            Comment


                              #15
                              Hello mic414,

                              Thanks for your post.

                              Regarding the generic question, "can I backtest multiple instrument strategies on historical data? ". Yes, you can backtest multiple instruments by selecting an instrument list as the instrument.

                              Regarding, "I created a simple strategy which trades 2 instruments, but it doesn't execute any trades against the 2nd instrument when I do a backtest." If your strategy code uses "addDatasereis(...), then you would need to make sure you are coding with the advanced order methods where the orders are placed relative to BarsInProgress or are bracketing according to BarsInProgress. For further details, please see "Entering, Exiting and Retrieving Position Information" in https://ninjatrader.com/support/help...nstruments.htm (We recommend a review of the entire link for a comprehensive view).

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Yesterday, 05:17 AM
                              0 responses
                              64 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              139 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              75 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              45 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              50 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X