Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Crosshair and Chart Text Colours

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

    Crosshair and Chart Text Colours

    Hi
    I am trying to change the crosshair color,Chartbackground,Axis Color and ChartText but am failing on 2 of them
    I was following the lead on this example.

    However I get different behaviours
    1.ChartBackground and Axis pen brush work fine
    2. Chart Text changes but then instantly reverts back to it's original color - so something else is taking over in on render I guess?
    3.Crosshair color - I can't get to change at all! It simply makes the crosshair disappear.

    Edit
    if I put the ChartText change in ONrender it works fine. But this seems awfully inefficient?
    Still no joy on the Crosshair color.

    here is the code snippet that I am using in OnBarUpdate

    Code:
        if(State == State.Realtime)
                        {
    
                        ChartControl.Properties.ChartBackground = myBrushUp;
                        ChartControl.Properties.AxisPen.Brush = TrendColor;
                        ChartControl.Properties.ChartText = TrendColor;//flips color but doesn't sustain
                        ChartControl.Properties.CrosshairPen = "Red";//TrendColor;// crosshair disappears
    ​
                        }​
    Last edited by Mindset; 10-23-2022, 09:41 PM. Reason: Addition of code in OnRender

    #2
    Hello Mindset,

    Please consider the note from the help guide:
    "Warning: These are UI properties which are designed to be set by a user. Attempting to modify these values through a custom script is NOT guaranteed to take effect. "


    Note, the CrosshairPen is not a brush that can be set. This a ToString() property and not the actual property used for the brush.

    I'm not aware of a way to change the crosshair color through code, but it is possible to render custom lines. Note, this will be CPU intensive.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea
      Yes whilst trying to get it to work I have had crashes and all sorts of issues - so I will forget about the crosshair as the 3 things I have now are stable.
      It would have been nice and I have no idea why changing a crosshair colour should cause so much stress to the app!!
      Could I add it to the development list please.

      Comment


        #4
        Hello Mindset,

        I've submitted a feature request on your behalf for the development team to consider allowing the crosshair brush to be set from ninjascript.

        Once I have a tracking ID for this request I will post in this thread for future reference.
        Chelsea B.NinjaTrader Customer Service

        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