Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data comes and goes with multi-datastreams

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

    Data comes and goes with multi-datastreams

    Hi,

    I have an indicator that uses multiple datastreams. So I'm using...

    Add(PeriodType.Day, 1);

    It works fine.

    I then call that indicator from another indicator. But then I seem to get fairly random values.

    Maybe the first time I load it I get my values correctly. Picture 1.

    But then if I do 'Reload NinjaScript' I may get nothing. Picture 2.

    I assume it's something to do with data synching. Is there a way to make sure the data is loaded, so I don't get these blank values?

    Thanks
    Attached Files

    #2
    Hello,

    Thank you for the note.

    Is the Log tab of the Control Center reporting any errors? You might be using this indicator too early in the lifecycle. Try to configure it in the OnStartUp Override. This method is called right before OnBarUpdate starts to get called.

    Code:
    private SMA mySMA;
    
    protected override void OnStartUp()
    {
           mySMA = SMA(14);
    
    }
    I look forward to hearing of your results.

    Comment


      #3
      Thanks.

      1. There are no errors in the log files.

      2. To add to this, I noticed that it works fine when I'm offline, and also now the market is closed. It is only when the market is open and I'm connected that this issue occurs.

      3. I'm unable to use your code because the indicator I'm calling is in a DLL that is initialized in the Startup method of that indicator. I'm thinking of putting a dummy call in that allows me to call the DLL in the Startup method, but without it actually referencing the DLL. But I can't test this until the market is open on Monday. I'll report back then.

      Comment


        #4
        Hello,

        Thank you for the reply.

        There is not enough information here to provide an answer. Could you please provide a simplified example so I can test this on my end? It sounds like the indicator is failing on real-time data. You can test this out on the Markey Replay connection to simulate real-time data.

        Please see this link for instructions on exporting a script to attach to your reply:


        I look forward to your reply.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        566 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X