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

Panels

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

    Panels

    Hello,

    I want to draw in other Panels.

    I know that i have to set; IsOverlay=false; and
    DrawOnPricePanel = false; to get a new Panel.
    With this i can generate for every data series a new Panel.

    How can i now set Draw.RegionHighlightX(this,"Background "+h,BarsSinceEntryExecution(),0,Brushes.Red,Brushe s.Red,25); to Panel 4?

    #2
    Hello eleos,

    Thanks for your post.

    Can you provide further examples of your code that shows how you are "generate for every data series a new Panel."
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Code:
      else if (State == State.DataLoaded)
                  {
                      KChannel        = KeltnerChannel(OffsetMultiplier,Period);
                      rsi                    = RSI(Period,RSISmooth);
                      vol                   = VOL();
                      dmi                  = DMI(Period);
               
                  }
                  else if (State == State.Configure)
                  {
                  
                      AddChartIndicator(KeltnerChannel(OffsetMultiplier,Period));
                      AddChartIndicator(VOL());
                      AddChartIndicator(RSI(Period,RSISmooth));
                      AddChartIndicator(DMI(Period));
                      
                      IsOverlay                                     = true;       
                      DrawOnPricePanel                            = true;
                      ChartIndicators[0].Panel =0;
                      IsOverlay                                     = false;
                      DrawOnPricePanel                            = false; 
                      ChartIndicators[1].Panel =1;
                      IsOverlay                                     = false;
                      DrawOnPricePanel                            = false; 
                      ChartIndicators[2].Panel =2;
                      IsOverlay                                     = false;
                      DrawOnPricePanel                            = false;
                      ChartIndicators[3].Panel =3;
                }
      protected override void OnBarUpdate()
              {
                  if (BarsInProgress != 0) return;
                  if (CurrentBar < BarsRequiredToTrade) return;
      
      
      
                          DrawOnPricePanel = true;
                          if(case< 0){h++;
      0){Draw.RegionHighlightX(this,"Background"+h,BarsSinceEntryExecution(),0,Brushes.Red,Brushes.Red,25);
                        
                          t++;
                          Draw.Text(this,"txt"+t+".2","Open: "+Open[0]+" $ (Short)",0,High[0]+((High[0]/100)*1));
                          
                          b++;
                          Draw.VerticalLine(this,"Exit" +b+"."+counter, 0, Brushes.Black, DashStyleHelper.Dash, 2, false);
      }

      Data series may be the wrong word.
      So i load a few Indicators in a Strategie and gave them own Panels.
      Now i want to draw in each Panel and not only draw in one/all Panel/s.

      Comment


        #4
        Hello eleos,

        Thanks for your reply and clarifications.

        There are no means to draw objects in more than one panel from the strategy (or from an indicator). A strategy does allow you to add indicators and specify their panels but the strategy can only draw in its own added panel created with isOverLay = false; I've attached an example of this.

        I will submit a feature request to allow a strategy or indicator to be able to apply draw objects to any specified panel. I will update this thread when i have further information.
        Attached Files
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thank you for your fast help.


          Is there an alternative way ?


          Is it possible to let a Strategie call a Strategie (which is nearly a function/method and only draw on his Panel) and called this "Strategie" with parameters?
          Maybe synchronised .
          That all Panels have a own Strategie which draw and get the drawing orders from the main Strategie...
          Or something like that...?
          Last edited by eleos; 08-22-2018, 07:30 AM.

          Comment


            #6
            Hello eleos,

            Thanks for your reply.

            Strategies are not aware of other strategies and cannot call other strategies.

            I am not aware of another way to accomplish your goal.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hello eleos,

              I am happy to advise that when submitting the feature request I was advised that it is possible to accomplish your goal. I have attached an example that demonstrates drawing dots on all panels and drawing a region on a MACD in panel 3.

              The clue I was missing was replacing "this" with the name of the indicator, for example:

              In state.Dataloaded:

              MACD2 = MACD(13, 26, 9);
              AddChartIndicator(MACD2);
              MACD2.DrawOnPricePanel = false;
              MACD2.IsOverlay = false;

              Then in OnBarUpDate():

              Draw.Region(MACD2,"test", CurrentBar -1, 0, MACD2.Default, MACD2.Avg, Brushes.Transparent, Brushes.Pink, 30);

              This example is in the attached working strategy.
              Attached Files
              Paul H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by algospoke, Yesterday, 06:40 PM
              2 responses
              21 views
              0 likes
              Last Post algospoke  
              Started by ghoul, Today, 06:02 PM
              3 responses
              14 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              45 views
              0 likes
              Last Post jeronymite  
              Started by Barry Milan, Yesterday, 10:35 PM
              7 responses
              21 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by AttiM, 02-14-2024, 05:20 PM
              10 responses
              181 views
              0 likes
              Last Post jeronymite  
              Working...
              X