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

Indicators & custom dataseries

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

    Indicators & custom dataseries

    I'm missing something when it comes to using custom dataseries.

    The indicators take a data series. So if I make my own, say based on the close, then I can pass that to the indicator and I compare the result to the result without passing my data series. I get the same thing so I know that it's working.

    My question is some indicators use more than just the close price. If I pass them a BarsArray object, how do they get the open, high, low, & volume data?

    I found this problem when using force index. it uses volume. but if I'm using my own custom dataseries I have no way to give the volume information to force index. All I can pass in is a dataseries of the close.

    #2
    Hi cunparis, not sure I follow your post - for exmaple OHLC and Volume are already dataseries by default, so you could pass them in directly as done in the code for the Force Index you refer to. If you call this indicator from a strategy, there's no need to supply a dataseries for the input price or volume then.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi cunparis, not sure I follow your post - for exmaple OHLC and Volume are already dataseries by default, so you could pass them in directly as done in the code for the Force Index you refer to. If you call this indicator from a strategy, there's no need to supply a dataseries for the input price or volume then.
      Let's say I want to create my own data series for OHLC V. Just for a simple example, let's say I want it to be 1 bar behind. This doesn't make sense but it's a simple example. So in OnBarUpdate I have:

      closeSeries.Set(Close[1]);
      openSeries.Set(Open[1]);
      ...
      volumeSeries.Set(VOL()[0]);

      but how can I pass this OHLCV series to an indicator? Does the ForceIndex indicator take a data series that has close & volume? or does it take two data series one for close & one for volume?

      Comment


        #4
        You need to pass two dataseries then, one for your volume and for the close prices. The ForceIndex version I have does not offer to pass in dataseries inputs directly so you would need to modify the code to open this up.

        If you want to pass one dataseries to another indicator, you would need to expose them first to make them accessible. For this please see this reference sample - http://www.ninjatrader-support2.com/...ead.php?t=4991
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          You need to pass two dataseries then, one for your volume and for the close prices. The ForceIndex version I have does not offer to pass in dataseries inputs directly so you would need to modify the code to open this up.

          If you want to pass one dataseries to another indicator, you would need to expose them first to make them accessible. For this please see this reference sample - http://www.ninjatrader-support2.com/...ead.php?t=4991
          Thank you for the precision. I couldn't figure out how to use force index with my custom dataseries. Now I know it's just because the indicator hasn't been programmed to accept them.

          Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DawnTreader, 05-08-2024, 05:58 PM
          23 responses
          84 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by DustyContrer, Today, 04:02 AM
          0 responses
          3 views
          0 likes
          Last Post DustyContrer  
          Started by ETFVoyageur, Today, 02:15 AM
          0 responses
          11 views
          0 likes
          Last Post ETFVoyageur  
          Started by Board game geek, Today, 01:34 AM
          0 responses
          9 views
          0 likes
          Last Post Board game geek  
          Started by morrnel, 05-12-2024, 06:07 PM
          3 responses
          45 views
          0 likes
          Last Post wzgy0920  
          Working...
          X