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

send indicator to a new panel in my strategy

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

    send indicator to a new panel in my strategy


    Hi, I am designing a strategy that uses a custom indicator. when I activate it, that indicator incorporates it in the same panel as the price, and I have to drag it each time to a new panel, which is quite uncomfortable. I have activated the if (State == State.SetDefaults) ........ IsOverlay = true; But it's not working. What would be the correct code to send it to a new panel? I have not found anything in the help of ninja. Thank you
    Attached Files

    #2
    Hello manueldecastro,

    Thanks for your post.

    When IsOverLay is set to true, in an indicator script, it would put it in the price panel.

    Can you clarify if you are adding the indicator to the chart with AddChartIndicator()?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      else if (State == State.DataLoaded)
      {
      OrderFlowCumulativeDelta1 = OrderFlowCumulativeDelta(Close, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Type.BidAsk, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Period.Bar, 0); // DELTA ACUMULADO EN BAR
      AddChartIndicator(OrderFlowCumulativeDelta1);

      ATRticks1 = ATRticks(Close, 1);
      mediaatr = SMA(ATRticks1, Periodoatr);
      mediaatr.Plots[0].Brush=Brushes.Blue;
      mediaatr.Plots[0].PlotStyle=PlotStyle.Bar;
      mediaatr.Plots[0].AutoWidth=true;
      AddChartIndicator(mediaatr);

      }

      mediaatr is the indicator i need in a new panel

      Comment


        #4
        Hello manueldecastro,

        Thanks for your reply.

        Please try: mediaatr.Panel = 2;

        (Or other panel number).
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          it works! thanks!

          Comment


            #6
            I´m still working on my strategy. I want to separate plots indicators on different panels.
            I have set every indicator to xxx.panel=1, 2 but it doesnt work.
            Can anybody help me?
            I need momentum with max/min momentum on panel 2 and rsi with max/min rsi on panel 3.


            HTML Code:
            else if (State == State.DataLoaded)
            {
            MAX1 = MAX(High, 22);
            MAX2 = MAX(High, 8);
            distanciaentremaximos= MAX(High,Velamax-velazonashort+50);
            
            MIN1 = MIN(Low, 22);
            MIN2 = MIN(Low, 8);
            
            EMA1 = EMA(Close, 3);
            RSI1 = RSI(Close, 14, 3);
            Momentum1 = Momentum(Close, 14);
            
            
            MaxMomentum = MAX(Momentum1, Convert.ToInt32(VelasDivergencia));
            MinMomentum = MIN(Momentum1, Convert.ToInt32(VelasDivergencia));
            
            MaxRSI = MAX(RSI1.Default, Convert.ToInt32(VelasDivergencia));
            MinRSI = MIN(RSI1.Default, Convert.ToInt32(VelasDivergencia));
            
            MaxMomentum.Plots[0].Brush = Brushes.MediumPurple;
            MinMomentum.Plots[0].Brush = Brushes.MediumPurple;
            MaxRSI.Plots[0].Brush = Brushes.Orchid;
            MinRSI.Plots[0].Brush = Brushes.Orchid;
            
            AddChartIndicator(MaxMomentum);
            AddChartIndicator(MinMomentum);
            AddChartIndicator(MaxRSI);
            AddChartIndicator(MinRSI);
            
            MaxMomentum.DrawOnPricePanel=false;
            MinMomentum.DrawOnPricePanel=false;
            MaxRSI.DrawOnPricePanel=true;
            MinRSI.DrawOnPricePanel=false;
            
            Momentum1.Panel =2; // Dont work
            MaxMomentum.Panel =2; // Dont Work
            MinMomentum.Panel =2; // Dont Work
            
            RSI1.Panel =3; // Dont work
            MaxRSI.Panel =3; // Dont Work
            MinRSI.Panel =3; // Dont Work
            
            MaxMomentum.IsOverlay=false;
            MinMomentum.IsOverlay=false;
            MaxRSI.IsOverlay=false;
            MinRSI.IsOverlay=false;
            
            SetProfitTarget("", CalculationMode.Ticks, Target);
            SetStopLoss("", CalculationMode.Ticks, Stop, false);
            }

            Comment


              #7
              Hello manueldecastro,

              Thanks for your reply.

              I've attached a screenshot below that shows how this works.
              Please compare the code shown with yours to see what is missing/different in yours.

              Click image for larger version

Name:	manueldecastro-1.PNG
Views:	275
Size:	126.4 KB
ID:	1153027



              Paul H.NinjaTrader Customer Service

              Comment


                #8
                Working! thanks!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by CortexZenUSA, Today, 12:53 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Started by CortexZenUSA, Today, 12:46 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Started by usazencortex, Today, 12:43 AM
                0 responses
                5 views
                0 likes
                Last Post usazencortex  
                Started by sidlercom80, 10-28-2023, 08:49 AM
                168 responses
                2,265 views
                0 likes
                Last Post sidlercom80  
                Started by Barry Milan, Yesterday, 10:35 PM
                3 responses
                12 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Working...
                X