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.

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

    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.
    Kate W.NinjaTrader Customer Service

    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.
        Kate W.NinjaTrader Customer Service

        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.
          Kate W.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by libertyworkc, Today, 03:09 AM
          0 responses
          1 view
          0 likes
          Last Post libertyworkc  
          Started by SusanBarnesa, Today, 03:00 AM
          0 responses
          2 views
          0 likes
          Last Post SusanBarnesa  
          Started by visentialsmax, Today, 02:27 AM
          0 responses
          1 view
          0 likes
          Last Post visentialsmax  
          Started by visentialsmax, Today, 02:26 AM
          0 responses
          3 views
          0 likes
          Last Post visentialsmax  
          Started by JorgaShaw, Today, 02:03 AM
          0 responses
          1 view
          0 likes
          Last Post JorgaShaw  
          Working...
          X