Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Update of Drawing Objects

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

    Update of Drawing Objects

    I'm new to Ninja, and one of my first little script projects leaves me with this problem:

    The plan is to draw a horizontal line on the chart representing the current bid/ask. Ninja apparently displays last trade price for the chart bar, and occasionally bid/ask will wander away from the last trade.

    I order the bid/ask lines to be drawn inside OnMarketData() event.

    The lines do not seem to be drawn/redrawn unless there is a change in the last price ( a tick) on the chart.

    How do I force an update of the chart when I draw/redraw a horizontal line?
    Attached Files
    Last edited by phylum; 05-27-2008, 01:04 PM.

    #2
    Your observation is correct. We currently do not support forced repaints of the chart from a script.
    RayNinjaTrader Customer Service

    Comment


      #3
      Well, put it on your "things to do" list, please...

      Comment


        #4
        Thanks for the suggestion. We will add it to the list for you.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Has that "to-do-item" been done yet?
          I've come across the same issue when calling DrawText() from within OnMarketData(). The chart doesn't update unless there's a new Tick coming in.
          I'm using 7.0.1000.9...

          Comment


            #6
            johanps68, welcome to our forums - that item is still active on our feedback list for future consideration, I've added your vote in here as well.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              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...

              Comment


                #8
                Hi johan, phylum,

                I just made a simple indicator, which shows current bid/ask level and updates if those are updated regardless tick data (based to Johan's hint). The PVBidAsk indicator is downloadable free of charge from http://pvoodoo.com/IndicatorList.html

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by HFJ555, Today, 11:51 AM
                2 responses
                3 views
                0 likes
                Last Post HFJ555
                by HFJ555
                 
                Started by untobewertit, Today, 12:24 PM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_ChristopherJ  
                Started by DerkWehler, Today, 10:45 AM
                3 responses
                9 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by trdninstyle, 11-26-2024, 12:23 PM
                65 responses
                200 views
                0 likes
                Last Post trdninstyle  
                Started by Kathrax, 11-01-2023, 06:24 AM
                4 responses
                616 views
                0 likes
                Last Post sallys
                by sallys
                 
                Working...
                X