Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Unsynced DataSeries

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

    Unsynced DataSeries

    I want to create a data series that is not synced to the chart. How can I do that?
    Let me give you an example what I mean. (It is just an example, so it does not make much sense.)
    Let's say I have to SMAs. Whenever they cross, I want to put that price in a data series. Obviously, they won't cross on every bar, and I don't care about the times when they don't cross, so a synced DataSeries won't do. I could use an array or list, but I want to pass the result to another indicator, so it needs to be something that the indicators can take as an input.

    In silly pseudo code:
    IF (FastSMA == SlowSMA) {
    UnSyncData.Set(FastSMA[0])
    }
    IF (EnoughData) {
    Result = SMA(UnSyncData, Period)
    }

    #2
    Hello Titus,

    This is not supported by NinjaTrader Support to do in NinjaTrader 7.

    This thread will remain open for any community members that may know of a way or would like to assist.

    In NinjaTrader 8, a BarsRequest method was created to provide this functionality. This does not exist in NinjaTrader 7.
    Please let me know if you would like further information about BarsRequest in NinjaTrader 8.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the answer, ChelseaB.
      I looked at the BarsRequest here: http://ninjatrader.com/support/helpG...arsrequest.htm . Looks like (if I understand correctly) it does something completely different. Is there another BarsRequest maybe?

      Comment


        #4
        Hello Titus,

        The BarsRequest would allow you to request an arbitrary amount of data (unsynced) for any bar type from any instrument (including the primary instrument) and save this to a Bars object that can be supplied to an indicator.

        Can you detail how this is different from what you are trying to do?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          A big difference is that I don't want to work with bars data, just a selected set of 'double' values. Naturally, that selected set of doubles are derived from the bars, but after they have been derived the bars data is irrelevant.

          Let me detail my previous example.

          Let's say I have 180 minute bars between 9:30 and 12:30.
          There are two SMAs on the bars, one slow, one fast, and they cross every 30 minutes (weird market), at 9:30, 10:00, 10:30, etc. At each cross I get a price value, so 7 values altogether instead of 180 values (because I don't care about the values when they don't cross), for example: 2000, 2005.25, 1995.50, 2007.75, 2006, 2009.25, 2010.
          I want to take these 7 values, and pass it to another indicator, in this example another SMA, and see what comes out. For example, I start passing them after the 3rd value (because I have an SMA with a period of 3) each time I get a new value, so every 30 minutes.

          If I understood the RequestBars correctly, that does something else. I could ask for the bars from 9:30 to 10:30, and I would get 60 bars. Or I could ask for the whole period, and get 180 bars. Or I could ask for a specific bar, say at 10:45 and I would get 1 bar. But it would not give me the values for the SMA crosses, and I would not be able to pass that to the next SMA.

          I hope this clears it up a bit.

          Comment


            #6
            Hello Titus,

            To request data, even if its just a single bar, you would need to do a BarsRequest. You can do multiple of these.

            An indicator, however, will require a data series to process over. If you are planning to call an indicator and supply this with data and get values back, you will need a data series. Having a few arbitrary double values cannot be supplied to an indicator (for example the SMA).

            You could, of course, not call the moving average indicator, and calculate your own average using your own logic with arbitrary double values.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello Titus,

              An indicator, however, will require a data series to process over. If you are planning to call an indicator and supply this with data and get values back, you will need a data series.
              Yes, that is why I asked if an unsynced version is possible, so that one indicator could put it's results in there and then pass it on to other indicators. Just like it is possible to do this SMA(EMA(Close, 30), 50) I wanted to do something like this CustomInd1(CustomInd2.UnSync, Param2), Param1).

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by jclose, Today, 09:37 PM
              0 responses
              4 views
              0 likes
              Last Post jclose
              by jclose
               
              Started by WeyldFalcon, 08-07-2020, 06:13 AM
              10 responses
              1,413 views
              0 likes
              Last Post Traderontheroad  
              Started by firefoxforum12, Today, 08:53 PM
              0 responses
              10 views
              0 likes
              Last Post firefoxforum12  
              Started by stafe, Today, 08:34 PM
              0 responses
              10 views
              0 likes
              Last Post stafe
              by stafe
               
              Started by sastrades, 01-31-2024, 10:19 PM
              11 responses
              169 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X