Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

math round problme

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

    #16
    Originally posted by tomas1983 View Post
    hoooo, sry im so ninjatrader noob...

    i have 2 more quistion and then i will leave u alone...

    1) im trying to count the time that pass, the only count i found that not reset ever new bar is: DateTime.Now.Ticks
    is there smaller time count then ticks that not reset evry new bar? something like "Millisecond"
    I do not quite understand what you are asking. The time that passes between bars is a matter of subtracting the relevant bar times, to get a TimeSpan variable.

    2) i wanna comment on the chart, but the "ITextFixed" can only drawing in specific place, and canot be move...

    how can i draw text in custom place?

    tnx
    tom
    Use DrawText().

    Comment


      #17
      1) i wont to know how mach time as pass from tick to tick in milisecens resolution, but if i use "DateTime.Now.Millisecond" if reset to 0 when new bar is formed, and i lossing count...

      2) the "DrawText()" is not fixed. and will be move with the chart. i wont it to be fix on my window..

      Comment


        #18
        Originally posted by tomas1983 View Post
        1) i wont to know how mach time as pass from tick to tick in milisecens resolution, but if i use "DateTime.Now.Millisecond" if reset to 0 when new bar is formed, and i lossing count...
        Sorry, I still do not understand. If you want the time between events, you subtract the event times. The time from one bar to the next is the difference in the times when the bars complete.
        2) the "DrawText()" is not fixed. and will be move with the chart. i wont it to be fix on my window..
        Huh? You cannot say that you do not want it to be fixed, and you also do not want it to move. That is impossible in an absolute sense. Here is what you said that you wanted the first time out.
        2) i wanna comment on the chart, but the "ITextFixed" can only drawing in specific place, and canot be move...

        how can i draw text in custom place?

        Comment


          #19
          1) i dont wont to subtrack the time from bar to bar, i wont to know how mach time as pass from tick to tick. im milisecend, the problme is when 1000 milisecend is pass, the counter is reset to 0, the only parameter that count and not reset is "DateTime.Now.Ticks".. i will just use that and devided in 10,000,000 to get 1 sec.

          2) i wont to draw a fixed text on the chart, but i want 2 indicators to do so without the text overlap each other..
          if i will darw it like this:
          "DrawTextFixed("tag1", "Text to draw", TextPosition.TopRight);"
          the 2 indicators will overlap the text obj

          Comment


            #20
            Originally posted by tomas1983 View Post
            1) i dont wont to subtrack the time from bar to bar, i wont to know how mach time as pass from tick to tick. im milisecend, the problme is when 1000 milisecend is pass, the counter is reset to 0, the only parameter that count and not reset is "DateTime.Now.Ticks".. i will just use that and devided in 10,000,000 to get 1 sec.
            Still not clear what you are asking. You say you want a difference, then you complain about how an accumulation is being reset.
            2) i wont to draw a fixed text on the chart, but i want 2 indicators to do so without the text overlap each other..
            if i will darw it like this:
            "DrawTextFixed("tag1", "Text to draw", TextPosition.TopRight);"
            the 2 indicators will overlap the text obj
            There is a DrawTextFixed() overload that specifies the the location of the object. Use that overload. Read the NT Help.

            ref: http://ninjatrader.com/support/helpG...wtextfixed.htm

            The "Alphabetical Reference" is de riguer for code syntax; consistent reference to such a reference source is one of the secrets of successful coding. After all these years, I still end up digging in there pretty often.

            Finally, this has nothing to do anymore with a Math.Round() problem, which was the original subject matter of this thread. Please open your own thread to deal with your specific issue.
            Last edited by koganam; 12-31-2015, 09:36 AM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            85 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            48 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            29 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            32 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            67 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X