Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Timer events

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

    #16
    Originally posted by NinjaTrader_Dierk View Post
    Not sure I follow: You can call any NinjaScript method you'd like on the event handler (Draw... methods, order methods, anything). Why would you want to deal with the Plot method?
    ok. (my english is low but I'll attempt to explain my problem). I want to display over the chart the remaining time for every 5 min bar by DrawString function, second to second. And when one new bar begins, the down-counter is reinitializated to five minutes.

    But the down-counter doesn't work if NT doesn't receive ticks because DrawString is updated with the Plot method (Plot method is called when it is necesary replotting the chart, so, when one new tick is received.).

    However, the Josh's example works for printing in the output windows because it doesn't plot nothing.

    Thanks very much.

    Comment


      #17
      At this time we do not provide methods to force user defined repaints of the entire chart.
      RayNinjaTrader Customer Service

      Comment


        #18
        ok. Then I ' ll try to display the remaining time in an extern Windows Form by dll references.

        Thanks.

        Comment


          #19
          Independent timer

          Thought I would resurrect this issue as I have been trying myself to plot a bartimer independent of ticks.
          I run into the same issue; I can set a timer but the TriggerCustom Event will print but not plot correctly. ie printing goes nice and steadily each second but the DrawTextFixed waits for a tick despite not being in OnBarUpdate() - or at least it's 'jerky' and that is my interpretation.

          Can you assist or point me in the right direction?

          Code:
          	private void UpdateTimerEventProcessor(Object myObject, EventArgs myEventArgs)
          		{
          		TriggerCustomEvent(updateCustomHandler, updateTimer.Interval);
          		}	
          private void updateCustomHandler(object state)
          		{
          			Print("\tTime: " + Time[0].ToString("t"));
          	DrawTextFixed("tag",DateTime.Now.ToString("T"),TextPosition.TopRight);
          			
          		}

          Comment


            #20
            One way is to make a separate indicator to do the custom timer functions outside of OnBarUpdate(), like the supplied timers do (BarTimer). I would like to see a way to include in standard code with plots but have the same issues, updates to the counters only on bar updates.

            Dan
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #21
              Hi Mindset,

              I have a reply for you that I need to confirm with a colleague. I will reply shortly.
              TimNinjaTrader Customer Service

              Comment


                #22
                Nt7

                eDanny
                Thanks for pointing me there - I didn't realise how much the code had changed with v7.
                I think I can see what they are doing and should be able to manipulate to my own needs.

                Comment


                  #23
                  Hi Mindset,

                  Great, glad to hear it.
                  TimNinjaTrader Customer Service

                  Comment


                    #24
                    In download section

                    I found this searching for something else... and realised I had forgotten to post the finished thing. Look here.
                    Or search for Bar Timer Flash.
                    Last edited by Mindset; 01-25-2011, 09:40 AM.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    578 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    334 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
                    554 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    551 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X