Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

graphics within custom bartypes

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

    graphics within custom bartypes

    Hello, i am working on a couple of custom bar types - one of them i considered it useful to display a text marker or arrow on the chart as the bar evolves which conveys which state the bar is in.

    I tried to use the Draw.ArrowUp method and needed to add the required 'using' declarations and receiving error Argument 1 : cannot convert from Ninjatrader.NinjaScript.BarsTypes.xxx' to NinjaTrader.NinjaScript.NinjaScriptBase

    Obviously the key difference for a an indicator at the top is it is derived from Indicator and references the NinaTrader.NinjaScript.NinjaScriptBase
    whereas a bartype derives from BarsType and reference Bartypes names space.

    Is it possible to derive from both to achieve the drawing effect here -

    For the most part graphics are handled separately in indicator methods and overlayed onto the bars on the chart but wondered if i could generate some graphics within the bartype code itself. This may not be possible or advisable and am seeking some confirmation on this

    thanks

    #2
    Hello soulfx,

    No, drawing objects are not available to bar types. Drawing objects can be called from Indicators and Strategies.

    For any custom drawing, you can do this in a ChartStyle in the PaintBars override using the graphics library (GDI+).

    This would be an undocumented approach and resources are few, however, below is a link with some information about custom drawing in a ChartStyle.
    http://ninjatrader.com/support/forum...ad.php?t=22821

    However, from your description, it would seem that you could achieve your goals using an indicator that works with this bar type, allowing you to use NinjaScript drawing objects.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,605 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    8 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    4 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    13 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X