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

Getting an indicator into strategy

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

    Getting an indicator into strategy

    Hello,Support!

    Have no problem to get any indicator into strategy,but there`s one i can`t figure why it`s not showing on the chart.The strategy compiles,all the parts in place,but the indicator shows only partially and not being called via strategy.Could you please suggest the reason what may cause the indicator to show up just partially and not being called?

    Thank you!

    #2
    Does this help?

    Comment


      #3
      Originally posted by sledge View Post
      No.Just like i said.I have no problem with all that,i can put any indicator into strategy,but the one i have an issue with probably has some intentional bug to prevent it from being displayed or called via strategy.it`s an open source though.

      Comment


        #4
        @sledge,

        maybe you can tell whta it is?
        Attached Files

        Comment


          #5
          It`s rathe advanced study,so needs more then i can bring.

          Comment


            #6
            Originally posted by outsource View Post
            It`s rathe advanced study,so needs more then i can bring.
            What is the error in your log?

            Comment


              #7
              Hello outsource,

              The indicator you have provided loads without issue on my chart.

              Is this the indicator you are attempting to add through your strategy?

              Can you provide the full syntax you are using for the Add() method to call this in your strategy?
              Zachary G.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by koganam View Post
                What is the error in your log?
                Hi,Koganam,

                yes,there`s an error in the log,i didn`t look at it at first,but it tells nothing to me anyway.

                There error is:

                Method:Void OnBarUpdate() Exception: System.IndexOutOfRange

                Comment


                  #9
                  Originally posted by outsource View Post
                  Hi,Koganam,

                  yes,there`s an error in the log,i didn`t look at it at first,but it tells nothing to me anyway.

                  There error is:

                  Method:Void OnBarUpdate() Exception: System.IndexOutOfRange
                  Can anyone assist with that one?

                  Comment


                    #10
                    Originally posted by outsource View Post
                    Can anyone assist with that one?
                    That often means that you do not have enough bars at the time that a statement is processed. Try increasing the BarsRequired property in the Strategy.

                    Is there also an error in your Output Window?

                    Comment


                      #11
                      Originally posted by koganam View Post
                      That often means that you do not have enough bars at the time that a statement is processed. Try increasing the BarsRequired property in the Strategy.

                      Is there also an error in your Output Window?
                      Increased BarsRequired,no errors in the Output Window.But it doesn`t solve the issue.

                      Comment


                        #12
                        Originally posted by outsource View Post
                        Increased BarsRequired,no errors in the Output Window.But it doesn`t solve the issue.
                        Where did you increase it? In the code or in the PropertyGrid? If in the code, did you remove and reload the Strategy?

                        Comment


                          #13
                          Originally posted by koganam View Post
                          Where did you increase it? In the code or in the PropertyGrid? If in the code, did you remove and reload the Strategy?
                          Both,and did remove and then reload a strategy.All the same.
                          Attached Files

                          Comment


                            #14
                            Originally posted by outsource View Post
                            Both,and did remove and then reload a strategy.All the same.
                            Well, that is the low-hanging fruit. If the problem is not there, then your Strategy code shall have to be examined to find the problem: it must be in how the Strategy is calling the indicator.

                            As a last test, you might try increasing BarsRequired to a much larger number. I just had to do that with something that I was writing. Once a very large number worked, it was easy to see where the problem code was. In that case too, the indicator worked fine when applied to a chart, but gave me this same message that you are getting when I called it from a Strategy.

                            I do not look at other programmer's secret code, because I do not want to later be accused of stealing anybody's code: I cannot have stolen code that I have never seen. So unfortunately, I can be of no further help.

                            All the best.

                            Comment


                              #15
                              The strategy is fine,it calls any indicators i put in.And that`s NOT a stolen code,it`s available for free download.Plus there`s nothing that be telling do not change or do anithing with the code.If that was the case i wouldn`t put it here.The reason i put it here was just the author that didn`t reply for the request.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Gerik, Today, 09:40 AM
                              2 responses
                              6 views
                              0 likes
                              Last Post Gerik
                              by Gerik
                               
                              Started by RookieTrader, Today, 09:37 AM
                              2 responses
                              11 views
                              0 likes
                              Last Post RookieTrader  
                              Started by alifarahani, Today, 09:40 AM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by KennyK, 05-29-2017, 02:02 AM
                              3 responses
                              1,285 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              11 responses
                              186 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Working...
                              X