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

Multiple Choice of MA's

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

    Multiple Choice of MA's

    Apologies if this has been asked elsewhere.

    Suppose that I want to modify the MACD Indicator so that I can choose at any time the type of MA I want to use instead of the default SMA. Is there any sample code that allows one to see something that says "MA Type" which will allow one to choose from amongst several types and complete the configuration for the different period lengths? I hope that this makes sense.

    TIA

    #2
    Hello dmking,

    Yes actually we have a sample that nearly does what you are asking for, the concepts it demonstrates could easily be used in other indicators like the MACD. The sample demonstrates adding a drop-down list of MA types which can be selected and shows how the indicators logic can use that choice to delegate the result.



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

    Comment


      #3
      Thanks Jesse... Just what I was looking for.

      Comment


        #4
        Originally posted by NinjaTrader_Jesse View Post
        Hello dmking,

        Yes actually we have a sample that nearly does what you are asking for, the concepts it demonstrates could easily be used in other indicators like the MACD. The sample demonstrates adding a drop-down list of MA types which can be selected and shows how the indicators logic can use that choice to delegate the result.



        I look forward to being of further assistance.
        Is there logic that is able to utilize the samoleuniversalmovingaverage as when trying to impliment in my code it will not understand which the type of chosen MA when meeting conditions in the logic. What exactly are the terms generally to define that the code needs to call back and read which ever type of MA the user has defined pre starting the code.

        Comment


          #5
          Hello LoganJKTrader,

          I am not certain I follow what you are asking, are you trying to use the sample from a Strategy and need to know what MA was selected when you called it?

          Could you provide a sample scenario or the code you tried?
          JesseNinjaTrader Customer Service

          Comment


            #6
            Originally posted by LoganJKTrader View Post
            Is there logic that is able to utilize the samoleuniversalmovingaverage as when trying to impliment in my code it will not understand which the type of chosen MA when meeting conditions in the logic. What exactly are the terms generally to define that the code needs to call back and read which ever type of MA the user has defined pre starting the code.
            Study the code in BltTriggerLines.

            Comment


              #7
              Originally posted by bltdavid View Post

              Study the code in BltTriggerLines.
              THank you to the direction, though maybe was miss a usings and seems your code works by setting a usings rahter than expect it to call back the proper enum listed in it's own public class. What are the Trigger settings to do, is that able to allow to change the color when met or change and is it possible to use that single blt as a cross condition in itself and meeting a trigger condition?

              Comment


                #8
                I know people have used BltTriggerLines in
                the Strategy Builder, but I've never done so
                myself -- since I don't use that.

                This indicator shows how to prepare
                and instantiate two different MAs, as
                selected by the user via Dropdown
                selectors in the property grid.

                It watches for a crossover between
                these 2 MAs and then colorizes the
                interior region to show you the 'trend',
                which is Long when the Trigger crosses
                above the Average, and Short when the
                Trigger crosses below the Average.

                Import the indicator.
                Add the indicator to a chart.
                Play with the settings.
                Add Print statements to print interesting things.

                Experiment!
                Enjoy!


                Comment


                  #9
                  Originally posted by bltdavid View Post
                  I know people have used BltTriggerLines in
                  the Strategy Builder, but I've never done so
                  myself -- since I don't use that.

                  This indicator shows how to prepare
                  and instantiate two different MAs, as
                  selected by the user via Dropdown
                  selectors in the property grid.

                  It watches for a crossover between
                  these 2 MAs and then colorizes the
                  interior region to show you the 'trend',
                  which is Long when the Trigger crosses
                  above the Average, and Short when the
                  Trigger crosses below the Average.

                  Import the indicator.
                  Add the indicator to a chart.
                  Play with the settings.
                  Add Print statements to print interesting things.

                  Experiment!
                  Enjoy!

                  Hello David, adding the BltTriggerLines on code and hard coding it into my script the visuals are inverse to what it should calculate and the lines are improperly calculating, is there a reason you know why it does? Do you have any examples of it working as a entry condition?

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by habeebft, Today, 07:27 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post habeebft  
                  Started by Tim-c, Today, 03:54 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by rocketman7, Today, 01:00 AM
                  1 response
                  10 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by wzgy0920, 04-23-2024, 09:53 PM
                  3 responses
                  76 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by JonesJoker, 04-22-2024, 12:23 PM
                  9 responses
                  46 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X