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 sjsj2732, Yesterday, 04:31 AM
            0 responses
            33 views
            0 likes
            Last Post sjsj2732  
            Started by NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            286 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            284 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            133 views
            1 like
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            91 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Working...
            X