• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    Chris L.NinjaTrader Customer Service

    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:
        https://ninjatrader.com/support/help...t7/?export.htm

        I look forward to your reply.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by refine, Today, 05:02 PM
        0 responses
        1 view
        0 likes
        Last Post refine
        by refine
         
        Started by White Fork, Today, 01:57 PM
        2 responses
        6 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by martyn73, Today, 02:45 PM
        2 responses
        8 views
        0 likes
        Last Post martyn73  
        Started by ct, Today, 12:48 PM
        4 responses
        22 views
        0 likes
        Last Post eDanny
        by eDanny
         
        Started by BrandonT1292, 07-30-2018, 07:32 PM
        11 responses
        400 views
        0 likes
        Last Post EllisEdi  
        Working...
        X