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.
    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 algospoke, Yesterday, 06:40 PM
          2 responses
          23 views
          0 likes
          Last Post algospoke  
          Started by ghoul, Today, 06:02 PM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          45 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          21 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          181 views
          0 likes
          Last Post jeronymite  
          Working...
          X