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 ETFVoyageur, Yesterday, 06:05 PM
            7 responses
            44 views
            0 likes
            Last Post ETFVoyageur  
            Started by betsuni_123, Today, 04:20 PM
            0 responses
            6 views
            0 likes
            Last Post betsuni_123  
            Started by Aquila_Welokk, 04-29-2024, 01:14 PM
            2 responses
            22 views
            0 likes
            Last Post Aquila_Welokk  
            Started by samish18, 04-17-2024, 08:57 AM
            22 responses
            107 views
            0 likes
            Last Post samish18  
            Started by Ashkam, 04-29-2024, 09:28 AM
            2 responses
            26 views
            0 likes
            Last Post Ashkam
            by Ashkam
             
            Working...
            X