• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Customized indicator does not get saved in template

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

    Customized indicator does not get saved in template

    I used the built-in HMA indicator as the basis for a customized version that I saved with a different name. I added code to color the indicator line according to the slope and also code to enable the user to select colors for the slopes. I placed three of these indicators on a chart as well as an EMA, then saved it as a template. I was surprised when I opened a new chart and applied the template that ONLY the EMA was displayed. I checked the template file and indeed, only the EMA was included.

    I then returned to the original chart and added the built-in HMA and saved this as a template. Once again, when applying the template to another chart, only the EMA and the built-in HMA were displayed, and the template file contained ONLY those two indicators.

    So why does my custom indicator work fine when selected from the Indicators list, but does not get included in the template?

    EDIT
    I see the log says error generating the XML document, so probably serialization problem. Will recheck the code.
    Last edited by DrDave; 11-13-2019, 07:22 AM.

    #2
    Hello DrDave,

    Thank you for your post.

    I've tested this with a few custom indicators and as of yet haven't been able to replicate it.

    If you're seeing an error generating the XML document, you're right, I would look at serialization. If you're not able to figure out where it's coming from, I'd be happy to take a look at the code if you're comfortable posting it.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by DrDave View Post
      I used the built-in HMA indicator as the basis for a customized version that I saved with a different name. I added code to color the indicator line according to the slope and also code to enable the user to select colors for the slopes. I placed three of these indicators on a chart as well as an EMA, then saved it as a template. I was surprised when I opened a new chart and applied the template that ONLY the EMA was displayed. I checked the template file and indeed, only the EMA was included.

      I then returned to the original chart and added the built-in HMA and saved this as a template. Once again, when applying the template to another chart, only the EMA and the built-in HMA were displayed, and the template file contained ONLY those two indicators.

      So why does my custom indicator work fine when selected from the Indicators list, but does not get included in the template?

      EDIT
      I see the log says error generating the XML document, so probably serialization problem. Will recheck the code.
      RESOLVED
      I was adding two custom colored brushes in Region Properties. The serialization example begins with
      [XmlIgnore]
      I assumed this would be in effect for all following code, but it is not. I began the code for the second brush without [XmlIgnore] and the indicator is not saved in the template and errors were found recorded in the log file. Simply adding [XmlIgnore] as the first line of code for the second brush definition fixed it.

      Comment


        #4
        Hello DrDave,

        Thank you for your reply.

        I'm glad to hear you were able to locate the cause of the serialization issue and get it squared away. Thanks for posting your resolution for other users that may run into the same thing!

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by martyn73, Today, 05:27 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by MichaelAlexander, 02-22-2017, 05:06 AM
        5 responses
        1,402 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by walter739, Today, 11:56 AM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by kevinfloresz, Today, 09:46 AM
        4 responses
        30 views
        0 likes
        Last Post kevinfloresz  
        Started by digibob, 12-13-2019, 10:01 PM
        7 responses
        21 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X