Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.

    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.

        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.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rocketman7, Today, 02:12 AM
            2 responses
            16 views
            0 likes
            Last Post rocketman7  
            Started by briansaul, Today, 05:31 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by PaulMohn, Today, 03:49 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by frslvr, 04-11-2024, 07:26 AM
            6 responses
            106 views
            1 like
            Last Post NinjaTrader_BrandonH  
            Started by trilliantrader, 04-18-2024, 08:16 AM
            6 responses
            26 views
            0 likes
            Last Post trilliantrader  
            Working...
            X