Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Objects in multi-timeframe indicators

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

    Draw Objects in multi-timeframe indicators

    Hello,
    I have a multi-timeframe indicator with four plots including the primary one. All works fine apart from when I code Draw.ArrowUp or Draw.ArrowDown signals. The arrows all occur at the correct bars, but all occur at the bottom of the screen instead of the Y axis position where I have coded them to appear. Is this an issue with the multi-timeframe?

    Below is a sample of the code I have used for the Arrow signal.
    Code:
    if(((Values[3][0] < 50 || Values[1][0] < 50) && CrossBelow(Values[0], 50, 1)) //660T or 5Min < 50 & Main CrossBelow 50
    			|| (Values[0][0] < 50 && (CrossBelow(Values[3], 50, 1) || CrossBelow(Values[1], 50, 1)))) //Main < 50 & 660T or 5Min CrossBelow 50
    				
    			{
    				Alert("myAlertStochK02", Priority.High, "StochK cross 50 bear signal", NinjaTrader.Core.Globals.InstallDir+@"\sounds\Alert1.wav", 10, Brushes.Red, Brushes.Black);
    				ArrowDown myTriangleDownB = Draw.ArrowDown(this, "MyTriangleDown" + CurrentBar, false, 0, High[0] + TickSize, Brushes.Magenta);
    				myTriangleDownB.OutlineBrush = Brushes.Black;
    			}
    Thank you.

    #2
    Hello GeorgeW,

    Thanks for your post.

    With a multi time frame indicator, do you have the code shown in your post segmented by the BarsInProgress? Each bars object will call the OnBarUpdate() so when you use High[0] as a reference to a y location, each bars object will provide a High[0] that points to that bars object unless the code you show is only run when BarsInProgress == 0.

    Can you provide a screenshot of the chart?

    Comment


      #3
      Hello Paul,

      Thanks for your response.

      I have wrapped all the OnBarUpdate code within if (BarsInProgress == 0), so it should presumably be seeing one instance of High[0]. I have attached an image of the chart for your information.

      Thank you.
      Attached Files

      Comment


        #4
        Hello GeorgeW,

        Thanks for your reply.

        The screen shot shows an indicator scale on the left side and a price scale on the right. The price scale shows that price is in the area of 1.8. Looking at the arrows compared to the indicator scaling the arrows are plotted just above 0 and below 5 so I suspect the arrows are being plotted to the indicator scale and not on the price panel scale.

        Please set (or add if not there), in State.SetDefaults, DrawOnPricePanel = true;

        Reference: http://ninjatrader.com/support/helpG...pricepanel.htm


        Edit - clarified adding if not there.

        Comment


          #5
          That has worked, Paul. Thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          646 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          367 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          107 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          569 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X