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

STRATEGY BUILDER PROBLEM WITH ''HMA(Convert.ToInt32(HmaPeriod))''

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

    STRATEGY BUILDER PROBLEM WITH ''HMA(Convert.ToInt32(HmaPeriod))''

    i have built the following two strategy builder conditions:
    CONDITION1
    HMA(Close, HmaPeriod)[0] > HMA(Close, HmaPeriod)[1]

    CONDITION2
    HMA(Close, HmaPeriod)[0] - (HMA(Convert.ToInt32(HmaPeriod))[1])) < HMA(Close, HmaPeriod)[1] - (HMA(Convert.ToInt32(HmaPeriod))[2]))

    CONDITION1 is ok, it is what i want.

    my problem is with ''HMA(Convert.ToInt32(HmaPeriod))'' in CONDITION2.
    both appearances of the term need to be ''HMA(Close, HmaPeriod)''

    i am having a devil of a time with it. i will continue to work on it. however
    any suggestions/advice will be much appreciated.

    #2
    Hello joemiller,

    Thanks for opening the thread.

    While you can force the Strategy Builder to display Close for the default input series by selecting another price object and switching back to Close, this syntax will not be displayed when modifying an offset of a condition.

    HMA(Convert.ToInt32(HmaPeriod))
    In your example, your offsets do not display the syntax for the Close data series, as the Strategy Builder treats this as the default price object.

    There is no functional difference to calling an indicator specifying Close and without specifying Close. Since Close is used as the default it is being used whether it is specified or not. You can assign it to a different Price Object and you will see different syntax.

    As a test, you may run the sample code attached on a chart. Please have the NinjaScript Output window open. You will see that specifying Close as a data series gives the same results as not specifying a data series at all.

    You should not need to force the Strategy Builder to show you certain syntax as it is functionally equal.

    Please let me know if you have additional questions
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      thanks jim. the quick response is much appreciated.

      no fault of yours, but i don't have a clue about what you just said.
      bottom line, am i good to go the way it is?

      Comment


        #4
        Hello joemiller,

        Sure, you can translate my response to:

        Syntax for indicators specifying Close as the input series gives the same results as syntax without specifying the input series. Your condition is set up as you like already.

        Let me know if you have any additional questions.
        JimNinjaTrader Customer Service

        Comment


          #5
          how would i go about making the input series something other than default [e.g.] ''Open'' instead of ''Close''?

          or if i wanted to explicitly specify ''Close'' instead of letting it default to ''Close''?
          Last edited by joemiller; 04-25-2017, 02:29 PM.

          Comment


            #6
            Hello joemiller,

            I have created a short video demonstrating this.

            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.


            If you want it to explicitly say Close in the Condition Builder, you will have to select another input series and then switch back to Close. As I mentioned in my previous post, it is not possible to force the Strategy Builder to show this syntax for an offset. To reiterate, this is merely a choice of aesthetics, it does not have any functional difference.

            Please let me know if you have any questions.
            Last edited by NinjaTrader_Jim; 04-25-2017, 02:39 PM.
            JimNinjaTrader Customer Service

            Comment


              #7
              thanks jim.

              i was/have been able to easily make the changes explained in the video.

              my problem was with the offset terms ....which, per your response, i now understand that it is not possible to force the Strategy Builder to show this syntax for an offset.

              so no wonder i was having a devil of a time!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by cre8able, Today, 03:20 PM
              1 response
              9 views
              0 likes
              Last Post cre8able  
              Started by fiddich, Today, 05:25 PM
              0 responses
              3 views
              0 likes
              Last Post fiddich
              by fiddich
               
              Started by gemify, 11-11-2022, 11:52 AM
              6 responses
              804 views
              2 likes
              Last Post ultls
              by ultls
               
              Started by ScottWalsh, Today, 04:52 PM
              0 responses
              4 views
              0 likes
              Last Post ScottWalsh  
              Started by ScottWalsh, Today, 04:29 PM
              0 responses
              9 views
              0 likes
              Last Post ScottWalsh  
              Working...
              X