Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator overload

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

    Indicator overload

    Can someone help me with this overload?
    The overload with the indicator is Attachment #1
    The overload per Intelisense is attachment #2

    I have not been able to make anything work
    ​​​​​​​IT_SuperD1 = IT_SuperD(
    Attached Files

    #2
    Hello galsermil,

    What part did you get stuck on?

    The overload on any method is simply variables in a comma separated list. You would type in one variable then a comma then the next.

    The types for each of its parameters are listed in the popup, for example that overload set asks for an input so the first parameter would need to be a series like Close:

    Code:
    IT_SuperD(Close, nextParameter,etc..
    There may also be a set of parameters that do not require an input, if possible press the up or down arrow key to see what other overload patterns exist.

    If you get stuck you can also try the strategy builder, select that indicator in a condition and then click View Code. That will generate the parameters in the OnStateChange section of the code.

    Comment


      #3
      Jesse,

      I took the easy way out and used the Strategy Builder but I have two questions. I copied the overload from the Strategy Builder and pasted it, as is, into my strategy. It compiles in the Strategy Builder but I get an error when compiling my strategy.
      The error is attached.

      My second question is that in the indicator parameters there are two uses of #FFFFFFFF. I believe this is to provide a special character from a different font but what would it replace in the overload. I do know that the indicator uses a circle with a number inside to let you know how many divergences apply to that bar
      Attached Files

      Comment


        #4
        Jesse, by copying all of the Using Declarations my Strategy compiled. Now I am getting an error message and my strategy is being disabled, The error message containus abbevation which I don't recognize:"2022-03-29 19:18:34:307|3|4|Indicator 'IT_SuperD': Error on calling 'OnStateChange' method: The calling thread must be STA, because many UI components require this."

        Maybe you can help me with this and I will still need a answer to my second question in my last email.

        Comment


          #5
          Hello galsermil,

          The first error you had seen was based on the using statement missing. The second error would relate to some code you have used in OnStateChange. The erorr does not specify what code but that is a runtime error so its something you are doing in the logic that is having a problem, not a compile error. You will have to reduce the code you used to find what part is having an error.

          The value: #FFFFFFFF is a Brush, this is how a color is represented in hex code. That would be a full white brush.

          Comment


            #6
            Jesse,

            Are you quite comfortable that my second error is related to code in OnStateChange as all of the code in that area is the AddPlot creating the signal and that massive overload. Is it possible the problem is differences in the parameters from the indicator and in the Strategy? What were those abbreviations specific to?

            Comment


              #7
              Hello galsermil,

              If the error says OnStateChange then that is where the problem is. I couldn't say if this relates to the indicator or not as that is a custom indicator, you could try using a system indicator in its place to see if you still get the error.

              Comment


                #8
                If the error is in that massive overload using a substitute indictor is not going to help. How is the order of the overload decided? I would think that it should be in the order of the property designation and only the creator of the script knows that. The only idea that we have is the order of his overload and that does not resemble our order or the order provided by Intellisense.

                Comment


                  #9
                  Hello galsermil,

                  You are seeing a runtime error and not a compile error, the problem would come from the indicator if the error happens when calling that code. It could be based on the settings in the overloads that you used however I wouldn't be able to say as that is a custom indicator. You would have to test and see what part is the problem that generates the error by changing out the indicator to see if it toggles the error off.

                  The only idea that we have is the order of his overload and that does not resemble our order or the order provided by Intellisense.
                  You would have a compile error if you entered the parameters in the wrong order. The builder would be the best way to generate the right syntax to use, that would output the overloads in the correct order with default values that you select in the user interface. If by doing that you see an error when using that indicator it may be that the indicator has a problem and cannot be used in that way.

                  Comment


                    #10
                    I don't understand what you mean by saying "cannot be used in that way.". As per the Strategy Builder, my overload is in perfect order with Intellisense but what is the rationale for his parameter order? When you look at his order which is all over the place, but they are filed in correctly. There are quite a few differences in the actual info being provided, for instance, our 'Period' is 14 and his is 10. Can that be causing the problem?

                    Comment


                      #11
                      Hello galsermil,

                      The strategy builder can select any indicator with a plot however not all indicators are designed to be used as a signal with a strategy. Some complex indicators may require using a Chart and cannot be hosted by a strategy. When you supply correct code you wont get a C# compile error by using the indicator in the code but it may produce a runtime error when you actually execute the script if it has a problem.

                      but what is the rationale for his parameter order?
                      The order is generated when the indicator is compiled based on the public properties in that script.

                      There are quite a few differences in the actual info being provided, for instance, our 'Period' is 14 and his is 10. Can that be causing the problem?
                      I am not sure what you are comparing here, are you comparing against some other PC? If so you could try using the exact same settings as a starting point.

                      Comment


                        #12
                        Unless I have made a mistake I have only found 4 differences when comparing my overload and the actual filled in parameter sheet with the indicator. The differences are 'Period' 14 vs 10, mine vs theirs, 'Remove Period', 0 vs 8, 'Up &Down Colors" Red/LimeGreen White/White in Hex Code. Do you think it is worth a shot to leave the order the same and change the input?

                        Comment


                          #13
                          Hello galsermil,

                          I would suggest to just try the exact settings if you are doing a comparison. If that does not work you would need to revert to trying a system indicator to confirm that the problem is coming from the custom indicator. The parameters likely are not the issue, it may just be that the indicator requires a chart based on the given error message. You can try contacting the developer of the indicator if you find that it is having problems when used with a strategy.

                          Comment


                            #14
                            2022-03-30 11:24:34:726|3|4|Indicator 'IT_SuperD': Error on calling 'OnStateChange' method: The calling thread must be STA, because many UI components require this.
                            What does the STA mean in the error message?
                            I tried changing just the info and I got the same error message

                            Comment


                              #15
                              Hello galsermil,

                              That is a C# error which generally relates to UI items and threading. This can be seen with more complex items that work with the platforms user interface or WPF controls.

                              Did you try using a system indicator to confirm the problem is specifically with the custom indicator? If so you will need to either review the custom indicators code or contact the developer for further assistance with that use case.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Today, 05:17 AM
                              0 responses
                              50 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              126 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              69 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              42 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              46 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X