Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Running Same strategy on different Instruments - odd result

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

    Running Same strategy on different Instruments - odd result

    Hi,

    I have a strategy that I wrote that I use on more than one instrument and I have odd results during testing.
    It is an automated strategy and is using a SIM account, but what I have seen is that the code which prints
    some Debug data does not track the debug output if two instruments are in a trade at the same time.

    Is there a known issue with running a single strategy on more than one instrument at a time? All my signals
    are timestamped and the trades are not entered at the same time. If this is a known issue then I can adjust
    so that I have copies of the same strategy for each instrument. Seems a waste to do that though.

    Thanks.

    #2
    Hello ATMtrader0001,

    When you say that the debug data does not track the debug output at the same time what specifically do you mean?

    Multiple instruments won't have exactly the same data events at the same intervals, they are individual markets. Using identical logic on two different instruments in realtime could result in your conditions becoming true at different times as each individual market has its own updates. The fills could also be at different times depending on the market.


    Comment


      #3
      So, for example at the close of a bar I will print some statistics for that bar for the instrument in question.

      What happens when I am in a trade for more than one instrument is that I only get the debug data for one of the trades.
      I get nothing on the other. I'll be more mindful if timing plays a part in which one on which I get the data.

      Comment


        #4
        Hello ATMtrader0001,

        Two strategies of the same type on separate instruments will not conflict with each other. Based on the details it sounds like either one of the strategies did not have its condition become true at the same time or your prints need to be adjusted. Without seeing what you coded it would be difficult to say however I can say that you should in general have unique results per instrument meaning that they won't identically match because each market has its own individual trades that drive the market.

        Comment


          #5
          I can't recreate it without actually placing multiple orders through the strategy.

          However it did do it this AM during the EU Opening hours. I was in a trade on one instrument and I was getting a reference of the Close[0] for the
          other instrument.

          I am using Close[0] in my code. Then after one exited the trade I was getting Debug that it was calling a Exit on the other trade, but that trade continued.
          I added additional code to include the instrument name. It just seems the Code is not getting the information correctly.

          Can I call InstrumentName.Close[0]?

          Comment


            #6
            Hello ATMtrader0001,

            Are you using a multi instrument strategy where you have used AddDataSeries in its code? A strategy can only manage positions that it creates. If you have not made a multi instrument strategy then it can only submit trades to or close positions on the primary instrument that you applied it to. We would need more specific details about what you coded to be able to provide more direct answers here.

            Comment


              #7
              Here is how I have it setup.

              1) I created a Strategy
              2) In the Strategies Tab I created a New Strategy for trading Crude Oil using the strategy in Step 1
              3) In the Strategies Tab I created a New Strategy for trading Natural Gas using the strategy in Step 1

              In the output window I was seeing inconsistencies with the data seeming to show Crude Oil data when both were in a trade at the same time.

              It is infrequent when it happens as I am rarely in a trade in both at the same time, but when it does I get odd results.

              Comment


                #8
                Hello ATMtrader0001,

                As mentioned two strategies that are applied separately on two different instruments cannot conflict with each other In this case you would need to provide more specific detail on what problem you are seeing in regard to the output and what you are trying in the code.

                Comment


                  #9
                  I would like to give you more information, but this happens so infrequently and I don't always capture the logs.

                  I'll change to write the logs to a text file.

                  Comment


                    #10
                    Hello ATMtrader0001,

                    You can do that however the logs by themself won't mean anything to me as I don't know what you are trying in the code. If you find an example you will need to extract the part of code that is related to the log so we can see what you are doing in code in comparison to the print. We would also need to know what the expectation was vs what you see is wrong.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Yesterday, 05:17 AM
                    0 responses
                    56 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    133 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    73 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
                    49 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X