Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing Chart Marker Size in Compiled Assembly

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

    Changing Chart Marker Size in Compiled Assembly

    Hello,

    Recently an update went live that added native support for different chart marker sizes. Naturally I would like to add support for it, but found some issues. I noticed that size enum cannot be directly called upon. From my understanding, anything compiled that is not native to C# has to be hard coded or that the namespace has to be explicitly stated.

    What's interesting is enum such as the DashStyleHelper I'm able to set directly when in a compiled assembly. For example,

    Code:
    newStrokeStyle = DashStyleHelper.DashDot;
    line.Stroke.DashStyleHelper = newStrokeStyle;
    DashStyleHelper is from the NinjaTrader.Gui.DashStyleHelper namespace. Initially I thought the same could be done with chart marker size like so,

    Code:
    newChartMarkerSize = ChartMarker.Small;
    chartMarker.Size = newChartMarkerSize;​
    This does not work (works non compiled though). This will throw a binding error. Instead a SetProperty() method is needed where it uses System.Reflection.PropertyInfo to change it "manually". Thankfully I had the bit of code in another indicator where changes nested properties in a Pitchfork and I think that's why it was used (Don't recall 100% if that's true). It now works.

    My question, is the DashStyleHelper something that is native in C# and that the NinjaTrader.Gui namespace integrates somehow? Again I don't fully have a grasp on the inner workings. Just find it odd that the code requires this manual method of setting an enum when the DashStyleHelper enum worked fine.

    Best regards,
    Unsuitable
    Last edited by Unsuitable; 01-19-2025, 11:36 AM.
    Unsuitable
    NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

Latest Posts

Collapse

Topics Statistics Last Post
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
557 views
0 likes
Last Post Geovanny Suaza  
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
0 responses
324 views
1 like
Last Post Geovanny Suaza  
Started by Mindset, 02-09-2026, 11:44 AM
0 responses
101 views
0 likes
Last Post Mindset
by Mindset
 
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
0 responses
545 views
1 like
Last Post Geovanny Suaza  
Started by RFrosty, 01-28-2026, 06:49 PM
0 responses
547 views
1 like
Last Post RFrosty
by RFrosty
 
Working...
X