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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            152 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            89 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            131 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            127 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            107 views
            0 likes
            Last Post CarlTrading  
            Working...
            X