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

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 mmenigma, Today, 02:22 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post mmenigma  
                  Started by frankthearm, Today, 09:08 AM
                  9 responses
                  35 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by NRITV, Today, 01:15 PM
                  2 responses
                  9 views
                  0 likes
                  Last Post NRITV
                  by NRITV
                   
                  Started by maybeimnotrader, Yesterday, 05:46 PM
                  5 responses
                  26 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by quantismo, Yesterday, 05:13 PM
                  2 responses
                  21 views
                  0 likes
                  Last Post quantismo  
                  Working...
                  X