Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

dump question

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

    dump question

    hi, i know this looks a dump question, but i am wondering why my result is not correct?



    private double Ticksize = 0.01;
    private double Lookback = 4;
    .
    .
    .
    .
    Print(Ticksize * Lookback);


    in output window i am getting 4 (instead of 0.04) what did i do wrong?

    #2
    Hello,

    Thanks for the note.

    I copied this on my side and I get:

    0.04

    in my output window. Suspect you have something else going on in your code.

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      i have attached the code, i dono where else to look, code is straight fw!
      let me know if you see anything strange??
      Attached Files

      Comment


        #4
        Hello,

        Can you please let me know what version of NinjaTrader you are using this is located in the Control Center under Help->About and is to the right of the NinjaTrader logo.


        Also, we have a variable in NT called TickSize already.

        Try this:Print(TickSize * Lookback);

        Finally, please try this:

        Print(0.04);

        Does this Print as 0.04?

        I look forward to assisting you further.
        BrettNinjaTrader Product Management

        Comment


          #5
          Hi,
          Actually i changed the variable to different name from Ticksize and it output the correct result.

          but you might notice that NT has compiled my code without errors, it should give me an error such as the variable already defined or something... this should be reported as a bug i guess.

          my version 7.0.1000.6

          Thanks for the good support.

          Comment


            #6
            Hello,

            Thanks for letting me know.

            I was actually able to do this without issue on my side so I do not suspect any NT issue. I suspect you have some public variable with the same name in another script some where that your conflicting with and getting you values you don't suspect. This would only happen if the variable is declared public.

            I look forward to assisting you further.
            BrettNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            163 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            313 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            245 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            350 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            179 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Working...
            X