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

Drawings from indicator invisible second dataseries

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

    Drawings from indicator invisible second dataseries

    Dear everyone,

    I've build an indicator with several drawings like:

    Draw.Line(this, Guid.NewGuid().ToString(), true, CurrentBar - idPast, indicatorPast, 0, indicatorPresence, Brushes.Red, DashStyleHelper.Dot, 1);


    This indicator should run on an second dataseries within a strategy.
    Therfore I've added an additional dataseries within a strategy:
    if (State == State.Configure)
    AddDataSeries(this.Instrument.FullName, BarsPeriodType.Minute, 10, Data.MarketDataType.Last);


    My Indicator is loaded via
    if (State == State.DataLoaded){

    myInd = MyIndicator(BarsArray[1]);
    AddChartIndicator(myInd);

    }


    The indicator with it's plotting is loaded and I can see the drawing lines.
    Unfortunately everything that is been drawed via Draw.* is not visible. When I load the indicator in the main dataseries as the strategy, the drawings are visible.

    Could anyone help to get the drawings visible?

    Thanks in advance.

    Cheers

    #2
    Hi all,

    I found out a major additional problem.

    It seems, that the additional-data-series is not been loaded if the chart selected period is lower than the requested one.

    Example:
    I open a chart with period of 30min. Than I add the strategy, that should add a dataseries of 10min (like in upper example).
    This seems to work, but the data seems to be not correct. (That seems to be the next problem).

    So, I opened a chart in 1min, but then the entire dataseries of 10min is not been loaded!
    E.g. the indicators "OnBarUpdate" section is also never been executed.

    Could anyone help, what I'm doing wrong?

    Thanks in advance.

    Cheers

    Comment


      #3
      Hello Airwave,

      Thank you for your post.

      If you would like to use a secondary series for the indicator's input, you would need to add the secondary series in the indicator itself as stated in the Notes section of the AddChartIndicator help guide documentation.

      An indicator being added via AddChartIndicator() cannot use any additional data series hosted by the calling strategy, but can only use the strategy's primary data series. If you wish to use a different data series for the indicator's input, you can add the series in the indicator itself and explicitly reference it in the indicator code (please make sure though the hosting strategy has the same AddDataSeries() call included as well)

      See the help guide documentation below for more information.
      AddChartIndicator - https://ninjatrader.com/support/help...tindicator.htm

      Let us know if we may assist further.
      Last edited by NinjaTrader_BrandonH; 05-17-2021, 08:31 AM.
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,607 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      9 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      19 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      6 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      16 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X