Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Same strategy with multiples instrument

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

    Same strategy with multiples instrument

    Hello! I have the same strategy operating in different instruments . for example :

    STRATEGY_NINJA instrument ES 09-22
    STRATEGY_NINJA instrument AMZN
    STRATEGY_NINJA instrument AAPL

    I have this in almost 20 instrument, but I realized this is causing a weird behavior. Some of these instrument stop receiving data, some of then are receiving normally but some just stop... for example GOOGL and AMZN should receiving data at the same time and I only receive one of then and the other stays stuck.

    I was wondering if there's a problem to have the same strategy in all these instrument or the problem could be another thing.

    Thanks!

    #2
    Hello 7robert,

    Thank you for your post.

    You mention that some of the instruments "stop receiving data" - I have some additional questions and tests to help clarify and narrow down the cause of what you are seeing.
    • When you say that some instruments stop, are you referring to the price movement on a chart or is the data stopping somewhere else in the platform? If somewhere else, please provide more details.
      • As a test to see if data is still flowing to the platform, please try updating your strategy to add Print() statements in OnBarUpdate() that contain the instrument and the time of the bar. Do the print statements stop appearing in the NinjaScript Output window as well or do they keep updating for the instruments in question?
      • Example of a Print() statement you could add: Print(String.Format("Instrument: {0} - Time: {1}", Instrument.FullName, Time[0]));
      • For more information about using prints to diagnose/debug your code, please see the forum post here: https://ninjatrader.com/support/foru...ing#post791121
    • How many instruments are you loading data for in total (not just those running a strategy)? Who is your data provider? Depending on your data provider, there may be a subscription limit for data. If you are reaching the limit, there may be error messages on the Log tab of the Control Center.
    • When running these strategies simultaneously, how is the utilization in the Task Manager? Is your CPU hitting a high/maximum percentage?
      • You may view this by right-clicking the Start menu > Select Task Manager > Expand "More Details" in the bottom-left if not already expanded > select the Performance tab and monitor while the strategies are running
    • Is there a specific instrument that is the culprit or does the instrument vary? Your example mentioned GOOGL and AMZN, although I am just curious if it is always one of those instruments or if it could be any of the instruments running the strategy that exhibits the behavior.

    I look forward to your reply.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Hello, thanks for your reply.

      I will answer all your question in order:

      1. When I say that the instrument "stop receiving data" I mean I cannot see the candles moving.. they stays frozen. But doesn't happen with specific instruments.

      2. The case that you previously mentioned to try to print instrument and time, it happens to us that the graph show candles but do not enter in State.Realtime on OnBarUpdate whereby we didn't get to do that print of time and instrument. But this doesn't happen with all instruments, that's why we think is a weird behavior of Ninja.

      As I mentioned before, It also happens that the graphs stop shows new candles therefore do not generate anything on OnBarUpdate.

      3. We have in total of 53 instruments, and our provider data is Kinetick.

      4. Our CPU is almost working at 90-100%

      5. I mentioned AMZN and GOOGL as an example, but I doesn't happen with specific instruments. It varies.. could happen with different instruments.

      Comment


        #4
        Hello 7robert,

        Thank you for that information.

        Since your CPU is getting up to 90-100%, I would like you to run the following test to see if you experience the same results when running a different strategy:
        • From the Workspaces menu in the Control Center, close all open workspaces and open a new blank workspace to test on
        • In the new workspace, add the SampleMACrossover strategy on a simulated account to the same instruments that you were running your other strategy on
        • Monitor the CPU usage in the Task Manager and any prints to the NinjaScript Output window
        • If the CPU usage seems okay while running the SampleMACrossover, disable that strategy in the test workspace and add your strategy instead
        • Repeat the test on your strategy and compare the CPU usage to the usage from the SampleMACrossover. Is there a notable difference or does it appear to be the same?

        I look forward to hearing the results of this test.
        Emily C.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by helpwanted, Today, 03:06 AM
        1 response
        11 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        9 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        387 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X