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

Inputing lines and numbers.

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

    Inputing lines and numbers.

    In my strategy i need to input the 80 line when using stochastics to go short and the 20 line for stochastics to go long. In addition, i must input my profit target. How do i input these variables?

    #2
    You would want to make these as parameters. Suggest you open up the SampleMACrossOver strategy and take a look at how it makes Fast and Slow inputs. Pay attention to the Variables and Properties region of the code.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      When inputing them what should i call them under description? It seems i have to name them something specific or else it wont work.

      Comment


        #4
        Description doesn't matter. Please see how they described the Fast and Slow. It is up to you. What matters is Category. Make sure that is set to Parameters.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          In case you didnt know i am using the strategy wizad to create this strategy. Whenever i try to create the inputs i say Oversold Stochastic Level but it says thats invalid. It must be something specific right? Also, is there any way i can optimize the profit target? Maby i can just input a price and i can say if last close crosses above that input sell.
          Last edited by iwun1; 12-25-2009, 10:02 PM.

          Comment


            #6
            How can I make an input a percent?
            Last edited by iwun1; 12-26-2009, 12:10 PM.

            Comment


              #7
              Hello,

              OK, you are using the Wizard. When you start to create a new strategy and you see the "user defined variables window" change "MyInput0" to any name that you want. For example you could use: "iwun1sOverSold". Once you have it named, if you want it to be a precentage change the type dropdown to "double". Doubles include value that have decimals (basically), which percentages do.
              I suggest looking at this link:
              DenNinjaTrader Customer Service

              Comment


                #8
                So if i made an input ProfitTarget or StopLoss and said double then .05 and had an exit strategy that would exit long position if price crosses under StopLoss it would work? How would NT know that its supposed to be .05% of price loss instead of price gain or instead of anything else? If it cant tell the difference, is there anyway I can differentiate the two? In fact, when using the strategy wizard to input variables, how does it know what i mean. For example, if i say buy when stochastic K crosses above Input 0(int 20) how would it tell what that 20 is.

                Sorry for the stupid questions-I came from Tradestation.
                Last edited by iwun1; 12-26-2009, 10:53 PM.

                Comment


                  #9
                  Hello,

                  I'm not totally sure what you mean here but I have attached screen shots of how you can get a % based target on an order (based a user input) and how you can do a cross above stoch. K based on a user input. The "MyInput0" is defined when you first create the strategy so you may need to start over. Also, not the "K" for the Stoch. plot.

                  You should attend on of our online strategy development courses, when it is offered, for free:
                  Attached Files
                  Last edited by NinjaTrader_Ben; 12-27-2009, 10:19 AM.
                  DenNinjaTrader Customer Service

                  Comment


                    #10
                    THanks that helped alot. So if I said buy when stochastic k crosses above input0 and defined input0 as Int20 it should work as a stochastic oversold level? When I tried this it didn't work so what should I revise? Should i try go long when stochastic= stochastic(value=Input0)?
                    Last edited by iwun1; 12-27-2009, 03:25 PM.

                    Comment


                      #11
                      iwun1, to make sure your NinjaTrader installation is working properly, please try creating the strategy with hard-coded values for cross above/below functions like in the attached picture. Instead of using a variable to determine when to buy/sell, you can just set it to 20.
                      Attached Files
                      AustinNinjaTrader Customer Service

                      Comment


                        #12
                        Thanks i got that working.
                        When i set the profit target/stop loss should i enter them as decimals or whole numbers because later on when making them the value for the stop loss/profit target i would make that number a percent?
                        Last edited by iwun1; 12-29-2009, 04:10 PM.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by DawnTreader, 05-08-2024, 05:58 PM
                        22 responses
                        82 views
                        0 likes
                        Last Post DawnTreader  
                        Started by Mathias79, Today, 03:44 PM
                        0 responses
                        17 views
                        0 likes
                        Last Post Mathias79  
                        Started by Austiner87, Today, 03:42 PM
                        0 responses
                        11 views
                        0 likes
                        Last Post Austiner87  
                        Started by lorem, 04-25-2024, 09:18 AM
                        19 responses
                        83 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by joselube001, 05-10-2024, 12:17 PM
                        6 responses
                        29 views
                        0 likes
                        Last Post joselube001  
                        Working...
                        X