Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculation Mode

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

    Calculation Mode

    Is there a way to set stops without using Calculation mode when using the wizard? I am not good enough with the programming side of things yet and I need to be able to set my stops to a price (actually a vaiable)that can be updated.

    #2
    Hello,

    Here is one way to do it. Let me know if you wanted something else.

    Go to your stop and targets section of your wizard and change the calculation to price as indicated in the screen shot. Then select the variable you want in the value field.
    Attached Files
    Last edited by NinjaTrader_Ben; 10-03-2008, 10:20 AM.
    DenNinjaTrader Customer Service

    Comment


      #3
      Still not working for me, although now I am sure it something I am doing wrong. Is there a way to output the current value of a variable so I can troubleshoot?

      Comment


        #4
        Hello,

        Yes, you can output by going to the Strategy Action section>Add>Misc>Print to output window.

        Open the output window by going to Tools>Output window.

        Now every time your strategy script is executed and your condition is met, it will output whatever message you have entered.
        DenNinjaTrader Customer Service

        Comment


          #5
          That appears to be only text though. What is the syntax to output a variable?

          Comment


            #6
            You will need to dive out of the Strategy Wizard and into the NinjaScript Editor to do this.

            Code:
            Print(variable.ToString());
            Remember that once the NinjaScript leaves the Strategy Wizard you cannot bring it back into it.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Well, I unlocked the code, made the change, tried to compile, and now I am getting an error "More than one protection modifier".

              Comment


                #8
                Stainless2000,

                Please attach your strategy and inform me as to which line in the code is the one causing the compile error. Thanks.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Actually, it no longer matters. I cannot use the wizard at all. I get that same error even when creating a new strategy that is blank.

                  I had to delete the strategy manually from the directory. Everything is fine now.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by muratb35, Today, 03:36 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post muratb35  
                  Started by fernlicht, Today, 02:16 AM
                  2 responses
                  9 views
                  0 likes
                  Last Post fernlicht  
                  Started by fernlicht, 04-12-2021, 06:01 PM
                  1 response
                  28 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Started by memonolog, Today, 02:10 AM
                  3 responses
                  6 views
                  0 likes
                  Last Post memonolog  
                  Started by orenytz, Today, 12:25 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post orenytz
                  by orenytz
                   
                  Working...
                  X