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

Support alternative data series with ohlc info

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

    Support alternative data series with ohlc info

    Hi,

    I have an indicator that makes bars. It works perfectly on the primary (default) data series, as you would expect. On a chart with 2 data series, if I change the input series of the indicator to the second data series, it no longer works properly.

    Can you point me to docs / provide a hint of code changes required to support the second data series? For info, the second data series is just an alternative time of the primary. It is a data series from the instrument, not another indicator input.

    I hope this makes sense.

    Thanks.

    #2
    Do you have an example that you can attach?

    Comment


      #3
      Hello pjsmith,

      Thank you for your post.

      When you use the secondary series as the input, does the indicator still calculate and just display differently than you'd expect, or does it give you an error, either on screen or in the Log tab of the Control Center?

      I agree with bltdavid, we'd really need an example of the code. Would you have an example script you could attach to your reply? You can remove any code unnecessary to replicate the issue.

      Thanks in advance; I look forward to assisting you further.
      Kate W.NinjaTrader Customer Service

      Comment


        #4
        it does not display as expected. To get the highs, lows, etc., I am using this in OnBarUpdate

        HAOpen[0] = Open[0];
        HAHigh[0] = High[0];
        HALow[0] = Low[0];
        HAClose[0] = Close[0];

        This works fine with default or single data series. When I add a second data series and try to use that as the input series, it no longer works as expected. This should work? There are no obvious issues doing this? Thanks.

        Comment


          #5
          Hello pjsmith,

          From the added details its really not clear what may cause that, we would likely need a example indicator that you can attach so we can test that.

          Its also not clear what is not displaying correctly, you mentioned it makes bars. Is it doing some custom plotting to make bars or is this a bar plot? An image of the expected vs difference could help here also.

          If you want to do a simple test you could try using a simple indicator like the SMA and do the same steps for applying it to see if that produces a problem. That would help weed out any problems in the manual steps you are doing if any.

          Please let us know if we may be of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Originally posted by pjsmith View Post
            it does not display as expected. To get the highs, lows, etc., I am using this in OnBarUpdate

            HAOpen[0] = Open[0];
            HAHigh[0] = High[0];
            HALow[0] = Low[0];
            HAClose[0] = Close[0];

            This works fine with default or single data series. When I add a second data series and try to use that as the input series, it no longer works as expected. This should work? There are no obvious issues doing this? Thanks.
            Did you try,

            HAOpen[0] = Opens[0][0];
            HAHigh[0] = Highs[0][0];
            HALow[0] = Lows[0][0];
            HAClose[0] = Closes[0][0];

            A second DataSeries in code is not a BarsArray, it will not provide OHLC values when used as an input series.

            Last edited by bltdavid; 07-30-2020, 09:42 AM.

            Comment


              #7
              Originally posted by bltdavid View Post

              Did you try,

              HAOpen[0] = Opens[0][0];
              HAHigh[0] = Highs[0][0];
              HALow[0] = Lows[0][0];
              HAClose[0] = Closes[0][0];

              A second data series is not a BarsArray, it will not provide OHLC values when used as the input series.

              Thank you muchly - No, I did not. But, I just did, and it seems to be working. Thanks for responding. Really appreciate it.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by llanqui, Today, 11:10 AM
              0 responses
              4 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Started by llanqui, Today, 10:29 AM
              0 responses
              5 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Started by llanqui, Today, 08:32 AM
              1 response
              11 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Started by lollers, Yesterday, 03:26 AM
              1 response
              53 views
              0 likes
              Last Post lollers
              by lollers
               
              Started by Salahinho99, 05-05-2024, 04:13 AM
              7 responses
              63 views
              0 likes
              Last Post Salahinho99  
              Working...
              X