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

can the strategy builder generate this code?

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

    can the strategy builder generate this code?

    can line#2 be generated by the strategy builder conditions window or must the code be unlocked?
    [i.e.] i can't figure out how to create line#2 within the strategy builder?

    line#1 if indicator[bar1] > indicator[bar2]
    line#2 then if (indicator[bar0] – indicator[bar1]) < (indicator[bar1] – indicator[bar2])
    Last edited by joemiller; 04-08-2017, 03:08 PM.

    #2
    Hello,

    Thank you for the post.

    This is possible using the builder.

    The first condition would just require selecting an indicator on the left column, select Greater than, and the other indicator on the right column.

    The second condition you could complete using Offsets and arithmetic.

    On the left column you would select the Indicator and for its Offset value click in the box to open the Input selector and choose the Second indicator. For the arithmetic select minus. Do the same on the right column selecting the BarsAgo as you go along.

    I look forward to being of further assistance.
    Attached Files
    JesseNinjaTrader Customer Service

    Comment


      #3
      many thanks jesse, that really helped ... a LOT!

      Comment


        #4
        I have successfully created a desired strategy for indicator ADL … guided by
        the attached images you provided.

        I actually need the same thing for the HMA Indicator, but the HMA is more
        complicated … so much so that I have not yet been able to successfully do it.

        Please help [e.g.] perhaps give me the same kind of guidance you provided
        for the ADL indicator.

        Comment


          #5
          Hello joemiller,

          Thanks for writing back.

          While I am unsure of the complete context of the condition you wish to create, you can use the Strategy Builder to create this same condition using an HMA instead of an ADL indicator. I have attached similar pictures setting up this condition using HMA's as an example.

          I have set the periods for these indicator's to be 14, this may vary depending how you wish to implement this condition.

          Please let me know if you have any further questions.
          Attached Files
          JimNinjaTrader Customer Service

          Comment


            #6
            thanks jim,

            I want my set1 conditions to be the 2 lines shown below … [set 2 will be a mirror image of set1].
            Just want to be sure that I clearly described what I need before I continue to try to implement
            your example to successfully generate line#2 … which so far i haven’t been able to do. Both
            conditions must be met. Line#1 is easy, Line#2 not so easy for me.

            Line#1 HMA(Close, 14)[1] > HMA(Close, 14)[2]
            Line#2 (HMA(Close, 14)[0] - HMA(Close, 14)[1]) < (HMA(Close, 14)[1] - HMA(Close, 14)[2])

            Comment


              #7
              Hello joemiller,

              Thanks for the reply.

              Your syntax is correct on the second condition. I've created a video tutorial that shows you how to create this condition in the Strategy Builder, as well.

              Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


              Please let me know if you have any further questions.
              JimNinjaTrader Customer Service

              Comment


                #8
                thanks jim ... that was really good help and much appreciated. i was able to readily create the desired condition

                (HMA(Close, 14)[0] - HMA(Close, 14)[1]) < (HMA(Close, 14)[1] - HMA(Close, 14)[2])

                now i am trying to simply replace period=14 with user input=HmaPeriod to obtain

                (HMA(Close, HmaPeriod)[0] - HMA(Close, HmaPeriod)[1])) < (HMA(Close, HmaPeriod)[1] - HMA(Close, HmaPeriod)[2]))

                So far i have not been able to do so. some more help will be much appreciated. i'm confident that my user input definition is ok [i.e.] once again my problem is with manipulating the condition builder windows to build my desired condition.

                Comment


                  #9
                  JoeMiller, I am very interested in the ability to use Strategy Builder for ever more complex strategies without unlocking the code.

                  This strategy seems like it would have very good examples to review. Is there any chance you would share your final draft? If you are willing but do not want it completely public, may I request you PM me?

                  Good trading ALL!

                  Comment


                    #10
                    Hello joemiller,

                    Thanks for the reply.

                    You can set a period to a variable by selecting the set text when you place your mouse over the Period field.



                    I've created a video demonstrating this as well: https://www.screencast.com/t/jxZwaqSK

                    While we are happy to assist you and provide you direction in using the Strategy Builder, this thread is beginning to escape the scope of support services that we provide. We have a webinar on using the Strategy Builder in NinjaTrader 8 where we like to direct educational questions regarding the Strategy Builder.

                    You can register for one of these webinars here: http://ninjatrader.com/Webinar/Strategy-Builder-301

                    Also available is a recorded version here: https://www.youtube.com/watch?v=_KQF2Sv27oE

                    Please let me know if I may be of further assistance.
                    JimNinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by JMont1 View Post
                      JoeMiller, I am very interested in the ability to use Strategy Builder for ever more complex strategies without unlocking the code.

                      This strategy seems like it would have very good examples to review. Is there any chance you would share your final draft? If you are willing but do not want it completely public, may I request you PM me?

                      Good trading ALL!
                      will do by all means, happy to share it ...no secrets involved. i will keep this thread updated. if i fail to do so just rattle my cage. the strategy is entirely fictitious, evolving as i have progressed for learning purposes. i randomly picked HMA because it is more complex than ADL. stand by ... i intend to continue ratcheting up the indicator complexity because the strategy builder is such a powerful tool for a non-programmer like me. well
                      worth the time. videos created by the platform support team are especially useful.

                      Comment


                        #12
                        Originally posted by NinjaTrader_Jim View Post
                        Hello joemiller,

                        Thanks for the reply.

                        You can set a period to a variable by selecting the set text when you place your mouse over the Period field.



                        I've created a video demonstrating this as well: https://www.screencast.com/t/jxZwaqSK

                        While we are happy to assist you and provide you direction in using the Strategy Builder, this thread is beginning to escape the scope of support services that we provide. We have a webinar on using the Strategy Builder in NinjaTrader 8 where we like to direct educational questions regarding the Strategy Builder.

                        You can register for one of these webinars here: http://ninjatrader.com/Webinar/Strategy-Builder-301

                        Also available is a recorded version here: https://www.youtube.com/watch?v=_KQF2Sv27oE

                        Please let me know if I may be of further assistance.
                        ok, thanks for all the great help jim. i will divert to the suggested help route in the future.

                        Comment


                          #13
                          i have finally succeeded in creating my desired condition displayed just below except for the unwanted term (HMA(CovertToInt32(HmaPeriod))[2])) ) at the end.

                          (HMA(Close, HmaPeriod)[0] - (HMA(CovertToInt32(HmaPeriod))[1])) < (HMA(Close, HmaPeriod)[1] - ((HMA(CovertToInt32(HmaPeriod))[2]) - (HMA(CovertToInt32(HmaPeriod))[2])) ))

                          question 1] any suggestions about the best sequence of steps to follow to get rid of the unwanted term at the end?
                          question 2] why is HmaPeriod sometimes expressed as HMA(CovertToInt32(HmaPeriod))?
                          question 3] why does ''Close'' sometimes appear and sometimes not?

                          Comment


                            #14
                            Originally posted by joemiller View Post
                            i have finally succeeded in creating my desired condition displayed just below except for the unwanted term (HMA(CovertToInt32(HmaPeriod))[2])) ) at the end.

                            (HMA(Close, HmaPeriod)[1] - (HMA(CovertToInt32(HmaPeriod))[0])) < (HMA(Close, HmaPeriod)[2] - ((HMA(CovertToInt32(HmaPeriod))[1]) - (HMA(CovertToInt32(HmaPeriod))[2])) ))

                            question 1] any suggestions about the best sequence of steps to follow to get rid of the unwanted term at the end?
                            question 2] why is HmaPeriod sometimes expressed as HMA(CovertToInt32(HmaPeriod))?
                            question 3] why does ''Close'' sometimes appear and sometimes not?
                            Never mind question#1, i simply created a new set of conditions from scratch. i am now suddenly sufficiently proficient to quickly step thru the process. As is always the case, when I finally understand the process I WONDER WHAT THE PROBLEM WAS ... IT IS SO EASY!!!

                            So the condition is now
                            (HMA(Close, HmaPeriod)[1] - (HMA(CovertToInt32(HmaPeriod))[0])) < (HMA(Close, HmaPeriod)[2] - ((HMA(CovertToInt32(HmaPeriod))[1])
                            and question#2 & question#3 still apply
                            [i.e.] question 2] why is HmaPeriod sometimes expressed as HMA(CovertToInt32(HmaPeriod))?
                            question 3] why does ''Close'' sometimes appear and sometimes not?

                            Comment


                              #15
                              THIS IS JUNK ... IGNORE IT

                              HMA(CovertToInt32(HmaPe)?
                              ques3] why does ''Close'' somses not?
                              Last edited by joemiller; 04-12-2017, 07:00 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by algospoke, Today, 06:40 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post algospoke  
                              Started by maybeimnotrader, Today, 05:46 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post maybeimnotrader  
                              Started by quantismo, Today, 05:13 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post quantismo  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              8 responses
                              168 views
                              0 likes
                              Last Post jeronymite  
                              Started by cre8able, Today, 04:22 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X