Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

drawings on barupdate superimposed with those from onrender

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

    drawings on barupdate superimposed with those from onrender

    Hello again, I have a problem since I am making an indicator that on the one hand draws when certain conditions are met in onbarupdate, normal drawings, text lines and rectangles, and in onrender later, when I select certain text-only drawings, it appears the most detailed information of that text using RenderTarget.FillRectangle(lineRect, currentBackgroundBrush2); and RenderTarget.DrawTextLayout(new SharpDX.Vector2(textLeft, textTop), textLayoutLine, textBrushDX2); The problem is that when I move through the graph, the onbarupdate drawings are mixed as if it had no opacity in on render and it has it at 100%


    The first problem is more critical, the second I have browsed the forum and it seems to have no solution at least for now, and it seems that they are collecting votes to change it, when drawing onrender I sometimes get a text that is too long, I solve it with this ;

    private void ChartControl_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
    {
    scrollOffsetY -= e.Delta * scrollStep / 120.0f; // e.Delta es normalmente un múltiplo de 120

    // Limitar el desplazamiento mínimo y máximo según el tamaño del contenido
    scrollOffsetY = Math.Max(scrollOffsetY, 0); // No permitir desplazamiento negativo
    // Puedes añadir una restricción máxima basada en el tamaño del contenido si es necesario

    // Redibujar el gráfico
    ChartControl.InvalidateVisual();
    }


    It works perfectly but it also moves the background graphic, I would like that while the drawing is active the graphic does not move horizontally, but I can't do it​.

    thank you very much again​

    #2
    Hello RubenCazorla,

    Preventing the intended behavior of the scrollwheel from adjusting the chart horizontal axis (time scale) range would not be supported by NinjaTrader.
    Unfortunately, I am not aware of any unsupported resources I can provide on this topic.

    Possibly setting the .Handled property to true may have an effect, but I would not be certain.
    ((HandledMouseEventArgs)e).Handled = true;

    This thread will remain open for any community members that would like to share unsupported suggestions.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by RubenCazorla View Post
      Hello again, I have a problem since I am making an indicator that on the one hand draws when certain conditions are met in onbarupdate, normal drawings, text lines and rectangles, and in onrender later, when I select certain text-only drawings, it appears the most detailed information of that text using RenderTarget.FillRectangle(lineRect, currentBackgroundBrush2); and RenderTarget.DrawTextLayout(new SharpDX.Vector2(textLeft, textTop), textLayoutLine, textBrushDX2); The problem is that when I move through the graph, the onbarupdate drawings are mixed as if it had no opacity in on render and it has it at 100%
      thank you very much again​
      Could you help me with this?

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      612 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      355 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      561 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      564 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X