Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

DrawText using OnMarketData

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

    DrawText using OnMarketData

    Hi,

    I'm trying to use DrawText with data calculated using OnMarketData which prints to the output screen correctly but doesn't seem to update via the DrawText method correctly and is somewhat delayed?

    Any reason as to why this would be?

    suprsnipes

    #2
    Hi, yes we would expect this difference to be seen - would suggest to review this thread where the same issue was discussed - http://www.ninjatrader.com/support/f...d.php?p=284863
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I checked out the post but don't quite understand how to implement...
      Originally posted by johanps68 View Post
      Actually, I found a way around this; the solution is to mimic the tricks in the BarTimer indicator. In essence, introduce a timer, trigger a custom event in the TimerEventProcessor() method, and then call
      ChartControl.ChartPanel.Invalidate();
      from within the custom event handler...
      . The other suggestion is a .dll and not much help either. Are there any other posts that I can look at obtaining a solution for this?

      Comment


        #4
        Actually after your suggestion I came across this...which seems to have made an improvement, thanks Bertrand.

        Originally posted by NinjaTrader_JC View Post
        Hello CuriProgrammer,

        For ChartControl.Refresh() you may want to try to put this inside of your OnMarketData event. For example:

        if (e.MarketDataType == MarketDataType.Bid){
        BidPrices[0] = e.Price;
        if(ChartControl != null) ChartControl.Refresh();
        }


        As for a supported method to do this you may use the a Plot and change the style to a Bar plot do something like the same for this. A good example is the "BuySellVolume" indicator that comes loaded inside of NinjaTrader.

        Let me know if that works for you.

        suprsnipes

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sightcareclickhere, Today, 01:55 PM
        0 responses
        1 view
        0 likes
        Last Post sightcareclickhere  
        Started by Mindset, 05-06-2023, 09:03 PM
        9 responses
        258 views
        0 likes
        Last Post ender_wiggum  
        Started by Mizzouman1, Today, 07:35 AM
        4 responses
        18 views
        0 likes
        Last Post Mizzouman1  
        Started by philmg, Today, 01:17 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by cre8able, Today, 01:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X