Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trouble with variable

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

    Trouble with variable

    Hi to all!

    I have a problem in trying to get one price (example, open of 10AM bar) with variable.

    How do I do this?

    I tried to do it as simple as set user variable0 = open bar (thru the builder) but it doesn't get fixed.

    Why is that?

    Thanks in advance!

    #2
    Hello efitor,

    Thank you for your post.

    Would you be able to provide a screenshot showing how you're trying to set the user variable in the builder that isn't working? Is the user variable a double?

    The first thing I would recommend would be to add prints to the strategy to help figure out what variables should be on a given bar. These will show in the NinjaScript Output window.

    This forum post goes into great detail on how to use prints to help figure out where issues may stem from — this should get you going in the correct direction. You can even add these using the Strategy Builder.



    If you run into issues like we saw here, the above information will allow you to print out all values used in the condition in question that may be evaluating differently. With the printout information you can assess what is different between the two.

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Yes of course!

      The variable is double as is a price.

      This is how I'm trying to do it.

      Comment


        #4
        Hello efitor,

        Thank you for your reply.

        User Inputs and user variables aren't the same thing in the builder. You can set up a user input, but Variable0 isn't isn't the same as that - those are hardcoded variables you could use in your strategy.

        If you add a print after the variable that just prints out the value of the variable, do you see this in a NinjaScript Output window?

        This forum post goes into great detail on how to use prints — this should get you going in the correct direction. You can add these using the Strategy Builder.

        https://ninjatrader.com/support/foru...ns-not-working

        Thanks in advance; I look forward to assisting you further.
        Last edited by NinjaTrader_Kate; 03-27-2020, 02:55 PM.

        Comment


          #5
          Hello efitor,

          Just wanted to follow up with you to see if you'd gotten the chance to try out adding a print of Variable0 - were you able to print the value successfully?

          Thanks in advance; I look forward to assisting you further.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          64 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          41 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          22 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          25 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          52 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X