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

Custom Indicators not saving/loading in Chart Templates

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

    Custom Indicators not saving/loading in Chart Templates

    Hello,

    I am presently working on converting my NinjaTrader 7 custom indicators to NinjaTrader 8R2.

    It has been a little bit challenging, but I am getting better.

    I am having an interesting problem that I can not seem to isolate. My custom indicators compile and plot just fine in Version 8R2. However, when I try to save and load a template it doesn't work. I cant tell if my custom indicators are not saving TO the template or loading from it.

    For example: I have a custom indicator called TrendHammer and a built in moving average indicator that came with Ninja 8. When I right click the chart and select (template->save as-> "jelIndicator") I get no error and it looks like it saved. Then when I create a new chart and right click (template->load->select "jelIndicator"), the only thing that gets loaded are the chart properties and the moving average. my TrendHammer indicator doesn't load .. so I have to load it manually.

    I am suspecting that my problem has something to do with the OnStateChange event but I cant figure out how to fix it.

    Thank,

    #2
    Hello,

    Thank you for the question.

    Do you get any error in the Log tab of the control center? I am not sure if you are only looking at the output window or not.

    If there are no errors, are you able to reduce the code and see this save? I would suggest to comment out the public properties you have and any logic that is associated and compile. Test if this can save and reduce further if needed.

    You may be able to more specifically debug the script as you know it best. My presumption is that some specific syntax in the script is causing a problem with serializing such as a property. I had based on you saying the moving average is still being loaded in the template.

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

    Comment


      #3
      Update

      The indicator compiles and plots just fine without error.

      I did, however, look at the log tab as you suggested and noticed the following....

      Right Click Chart..
      Click Template
      Click Save As
      Type in template name and click save

      produces the following error in the LOG tab ...

      could not save indicator "jelMMTrendHammer:" there was an error generating the XML Document

      Comment


        #4
        Hello,

        Excellent, there is an error so this points a more specific direction.

        Xml document not being saved would be related to Serialization, or writing the values of the properties you have to file.

        This is likely a problem with a property you are using.

        Without seeing the script and commenting the code out, it would be hard to say what specifically is happening but my prior instruction would be relevant to this situation.

        I would suggest to comment out the public properties you have and any logic that is associated and compile. Test if this can save and reduce further if needed.

        Removing the properties and associated logic will test if that is specifically the problem, if so you can further find the problem.

        If you are unable to locate the problem, you could post the script for me to review as well.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Perr0Grande, Today, 08:16 PM
        0 responses
        2 views
        0 likes
        Last Post Perr0Grande  
        Started by elderan, Today, 08:03 PM
        0 responses
        5 views
        0 likes
        Last Post elderan
        by elderan
         
        Started by algospoke, Today, 06:40 PM
        0 responses
        10 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        11 views
        0 likes
        Last Post maybeimnotrader  
        Started by quantismo, Today, 05:13 PM
        0 responses
        7 views
        0 likes
        Last Post quantismo  
        Working...
        X