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

Add Indicator

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

    Add Indicator

    I wish to add the DonchianChannel indicator in one of my strategies. For instance,

    Code:
    Add(DonchianChannel(LongEntryBand).Upper);
    Does not work but
    Code:
    Add(DonchianChannel(LongEntryBand));
    Is not a problem. Why can't I add say just the upper and lower lines of the DonchianChannel and lose the median line? Thank you

    #2
    cfree,

    I am happy to assist you.

    The Add method can only add full indicators or price data series. If you only want to plot the upper donchian channel, you would need to add your own plot to your indicator, and assign the upper donchian channel to it using something like :

    My_plot.Set( DonchianChannel(LongEntryBand).Upper[0]);

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      My_plot is setup as a variable and then assigned? I guess I am somewhat confused. Do I need to make my own indicator? Sorry, I am limited in my programming capabilities.

      Comment


        #4
        Yes, for this modification you would need to make a custom indicator to add where you then control what plots it displays and which not.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I setup my own indicator... now within my strategy when I call upon the indicator I get message CS1501.

          Every single place where I have the following code, I am receiving this error. I says it takes one argument and that is all I am implementing.
          Code:
          Add(DonchianChannelModifiedSD(LongEntryBand));

          Comment


            #6
            This is my indicator attached....
            Attached Files

            Comment


              #7
              Originally posted by cfree5119 View Post
              This is my indicator attached....
              The way you have coded it, your indicator requires 2 inputs; Period and NumStdDev. You cannot call it with just one input: you must provide both.

              Comment


                #8
                Koganam is correct. You needed to provide both parameters.

                Comment


                  #9
                  Thank you... after searching for a while I found out that it required two inputs just like you suggested. Appreciate the help.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by jxs_xrj, 01-12-2020, 09:49 AM
                  6 responses
                  3,290 views
                  1 like
                  Last Post jgualdronc  
                  Started by Touch-Ups, Today, 10:36 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post Touch-Ups  
                  Started by geddyisodin, 04-25-2024, 05:20 AM
                  8 responses
                  61 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by Option Whisperer, Today, 09:55 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post Option Whisperer  
                  Started by halgo_boulder, 04-20-2024, 08:44 AM
                  2 responses
                  24 views
                  0 likes
                  Last Post halgo_boulder  
                  Working...
                  X