Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unmanaged Strategy access to ChartControl

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

    Unmanaged Strategy access to ChartControl

    Unmanaged Strategy again...

    I see that NinjaTrader.NinjaScript.Strategies.ChartControl is an object
    accessible to NinjaTrader.NinjaScript.Strategies.Strategy instance.

    Of course I can subclass MyChartControl : ChartControl and override
    functions.

    Also, I see there is an inherited Get/Set property ChartControl yielding an object
    of type ChartControl.

    So this ChartControl object has a huge number of properties, etc. but sticking
    to a basic one, MouseDown is MouseButtonEventHandler UIElement.MouseDown
    event, so my question is how I can capture this event; by using the += event
    registration approach; or, preferably, using an override of OnMouseDown ???

    temporarily puzzled.

    So I'm just scratching my head wondering how to activate/use my subclass
    MyChartControl in the event dispatching structure. How do I gain access,
    for example, to the override "void OnMouseDown(MouseButtonEventArgs e)"

    As a basic, I'd like to get X,Y coordinates where Y is PRICE on the chart
    where the Mouse is left-clicked, and other such things.

    Thanks for some help, please point me in the right direction.
    Always appreciated !



    #2
    Hello Hyper,

    Thanks for your post.

    Attached is an example indicator that can demonstrate. This can be implemented in a strategy in the same fashion.

    We look forward to assisting.
    Attached Files

    Comment


      #3
      Hyper and Jim, Thank You both very much, just what I needed. Ken

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, Yesterday, 09:41 PM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, Today, 02:41 AM
      0 responses
      6 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, Yesterday, 11:44 PM
      0 responses
      17 views
      0 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      33 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      32 views
      0 likes
      Last Post CarlTrading  
      Working...
      X