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

Can't Draw In 2nd Data Series Panel 2

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

    Can't Draw In 2nd Data Series Panel 2

    Hello:

    I'm a Ninja beginner trying to draw in the secondary data series pane. The code below (general representation) compiles but produces no graphics in "Panel 2".

    Thanks for any ideas on what's going wrong here..

    /************************************/
    public void DrawSomething()
    {
    if (High[0]>=SomeConstant)
    DrawDot(" ", true, 0, High[0], Color.LawnGreen);
    }
    /************************************/
    protected override void Initialize()
    {
    Add("msft", PeriodType.Minute, 2);
    CalculateOnBarClose = true;
    }
    protected override void OnBarUpdate( )
    {
    if (CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired)
    return;
    if (BarsInProgress == 1)
    DrawSomething();
    }

    #2
    tradenj, unfortunately the series you're adding in programmatically here in Initialize() would not be visualized, it would just be internal for calculations and processing.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by tradenj View Post
      Hello:

      I'm a Ninja beginner trying to draw in the secondary data series pane. The code below (general representation) compiles but produces no graphics in "Panel 2".

      Thanks for any ideas on what's going wrong here..

      /************************************/
      public void DrawSomething()
      {
      if (High[0]>=SomeConstant)
      DrawDot(" ", true, 0, High[0], Color.LawnGreen);
      }
      /************************************/
      protected override void Initialize()
      {
      Add("msft", PeriodType.Minute, 2);
      CalculateOnBarClose = true;
      }
      protected override void OnBarUpdate( )
      {
      if (CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired)
      return;
      if (BarsInProgress == 1)
      DrawSomething();
      }
      Look up DrawOnPricePanel in NT Help.

      Comment


        #4
        More Ninja vs Wealth Lab

        Hi.
        -Again returning after days away and thanks for your responses.

        It looks like drawing in Panel 2 (i.e. on 2nd data series) is not possible in Ninja. I've also noticed that shapes/ text drawn to the primary pane don't remain there for perusal while scrolling back & forth through chart.

        Coming from Wealth Lab my trading approach involved notating figures & target lines (calculated by code) to intra-day historical and real time data charts. Empty panes could also be created there just for figure notation, graphics, etc.. These annotations were used while trading and for later study. I guess this isn't good for speed of execution here in Ninja, but please let me know if there'd be any means of accomplishing this sort of thing.

        One other question:
        Code:
         Add("NQ 3-13", PeriodType.Minute, 2);
        produces error message
        **NT** The strategy ... has called the Add() method with an invalid instrument. Either 'NQ 3-13' does not exist in the Instrument Manager or the specified exchange has not been configured
        .
        Further thanks for all of your help and ideas.
        Last edited by tradenj; 03-03-2013, 12:12 PM.

        Comment


          #5
          Originally posted by tradenj View Post
          Hi.
          -Again returning after days away and thanks for your responses.

          It looks like drawing in Panel 2 (i.e. on 2nd data series) is not possible in Ninja.
          Already answered. DrawOnPricePanel = false;

          Look it up in the NT Help.

          One other question:
          Code:
           Add("NQ 3-13", PeriodType.Minute, 2);
          produces error message .
          Further thanks for all of your help and ideas.
          That is because the instrument is "NQ 03-13", not "NQ 3-13".
          Last edited by koganam; 03-03-2013, 01:10 PM.

          Comment


            #6
            Hello:

            I appreciate your inputs.

            Re: Topic #1 I was using two data series rather than a data series and an indicator. So far I still haven't been able to draw or do BackColorSeries[] to Panel 2 under these circumstances. Everything goes to Panel 1 regardless of whether DrawOnPricePanel is set to true or false.

            Re: Topic #2 I idiot.

            Additional Question - Is there any way to refer to the chart end in Ninja? Take for example running a program on some days of historical intraday data, after which you want to print some calculated values to the output window (rather than to chart in Ninja).

            Thanks again.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Barry Milan, Today, 10:35 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,428 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, Yesterday, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            40 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Today, 08:51 AM
            2 responses
            16 views
            0 likes
            Last Post bill2023  
            Working...
            X