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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        63 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        87 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        47 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        104 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        63 views
        0 likes
        Last Post PaulMohn  
        Working...
        X