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

Need help with implementation

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

    Need help with implementation

    I'm a little confused as to how best to do this.

    I have an indicator where I have 2 instantiated Series<double> values. I would like these two values to be used to plot a bar, one as the open and the other as the close. Is there a way to use the Series<t> for that? Because there are two values needed to plot the bar, I'm confused. I am thinking that the end result would allow me to populate the Series<t> similar to "MySeries[0].open = ####" The open and close nomenclature is only for the purpose of showing the bar as green or red but has nothing to do with the current instrument price.

    #2
    Hello Chippy,

    A plot can be added to an indicator with AddPlot().

    Which generate a Series<double> in the Value series or Values collection.





    If you want candle sticks, these would need to written into a custom bar type, or rendered in OnRender().

    The HeikenAshi, AdvanceDecline, and Spread with Candlesticks indicators have this type of custom rendering.
    This is a corrected version of the Heiken Ashi BarsType that comes with NinjaTrader that aims to address the following issues: Values do not match rounded indicator (actual candle Open High and Low are not tracked and used in the BarsType) Realtime Close is incorrect (reloading historical data results in different results) The first bar [&#8230;]

    NYSE Advancing Issues/Declining Issues Uses historical tick data to calculate the ^ADV index minus the ^DECL index to give a simulation of the ^ADD index. Requires a data feed that supports indexes and provides data for the ^ADV (NYSE Advancing Issues) and ^DECL (NYSE Declining Issues). Update June 16th, 2020 &#8211; Corrected stroke attributes to [&#8230;]

    This is a conversion of the Spread Indicator with Candlesticks. Please contact the original author for any questions or comments.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea... but that doesn't help me. I don't know what I'm missing. First, I'm not looking for a "candle" with a wick. No OHLC... Just 2 values, open and close (high and low, if you prefer). I already have my addplot():

      AddPlot(new Stroke(Brushes.Yellow,2), PlotStyle.Bar, "Differential");

      What is the point of the Bar PlotStyle if I have to use Render?

      Also, anytime I try the "Values[][]" nomenclature I get an error "Cannot apply indexing with[] to an expression of type 'double'"

      Typically, I would just add the property and use that instead of Values[] but it's the second dimension I can't seem to do anything with. I can't access it or assign it a value. I'm thinking that that second dimension would work fine for me assuming that the addplot() can plot a bar of it. Think Cumulative delta indicator. That is essentially what my indicator will look like but with my own assigned data and no wicks.

      If I had access to the Order Flow Cumulative Delta source I would have looked there first.

      Comment


        #4
        Hello Chippy,

        Plots added with AddPlot() are single series. You can add multiple plots, for example one for the open and another for the close.

        The Bar plot style is a histogram. Open the VOL() indicator if you would like to see what this looks like.

        Values[plot index][barsAgo index] needs the plot index of the plots added in order with AddPlot().

        Values[plot index] is a plot
        Values[plot index][barsAgo index] is a double with the value of the plot on that bar

        See the MACD indicator for how multiple plots work.

        Unfortunately, the Order Flow indicators are proprietary and the source code is not available.

        However, I can say that this custom renders in OnRender() the same way the HeikenAshi, AdvanceDecline, and Spread with Candlesticks indicators do.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          That was helpful, thank you

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by techgetgame, Yesterday, 11:42 PM
          0 responses
          8 views
          0 likes
          Last Post techgetgame  
          Started by sephichapdson, Yesterday, 11:36 PM
          0 responses
          2 views
          0 likes
          Last Post sephichapdson  
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,613 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Yesterday, 05:56 PM
          0 responses
          10 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          20 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Working...
          X