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

Unable to Save Chart Template

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

    Unable to Save Chart Template

    I was trying to enable color selection for my MACD crossover signal. I compiled the script with no errors. However, when i try to save a Chart Template (with the custom indicator) i get the error below:

    Error on getting value for property 'MACDColor for Ninjascript'. Object reference not set to an instance of an object.


    Here are the codes related to the object. What I'm I missing?

    MACDColor = Brushes.Blue;

    [NinjaScriptProperty]
    [XmlIgnore]
    [Display(Name="MACDColor", Order=3, GroupName="Parameters")]
    public Brush MACDColor
    { get; set; }

    [Browsable(false)]
    public string MACDColorSerializable
    {
    get { return Serialize.BrushToString(MACDColor); }
    set { MACDColor = Serialize.StringToBrush(value); }
    }

    #2
    Hello cryfgg,

    What is the default value you are setting to the MACDColor property in State.SetDefaults so it is not null?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello cryfgg,

      Where is that code?

      I wouldn't expect an error if it is being set in State.SetDefaults.

      Can you provide an export of the script?

      To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
      1. Click Tools -> Export -> NinjaScript...
      2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
      3. Click the 'Export' button
      4. Enter a unique name for the file in the value for 'File name:'
      5. Choose a save location -> click Save
      6. Click OK to clear the export location message
      By default your exported file will be in the following location:
      • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
      Below is a link to the help guide on Exporting NinjaScripts.
      http://ninjatrader.com/support/helpG...-us/export.htm
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_ChelseaB View Post
        Hello cryfgg,

        Where is that code?

        I wouldn't expect an error if it is being set in State.SetDefaults.

        Can you provide an export of the script?

        To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
        1. Click Tools -> Export -> NinjaScript...
        2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
        3. Click the 'Export' button
        4. Enter a unique name for the file in the value for 'File name:'
        5. Choose a save location -> click Save
        6. Click OK to clear the export location message
        By default your exported file will be in the following location:
        • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
        Below is a link to the help guide on Exporting NinjaScripts.
        http://ninjatrader.com/support/helpG...-us/export.htm


        I was able to figure it out. I had to remove and re-insert the indicator back into my chart for it to work.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ラリー, Yesterday, 11:17 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by ラリー, Yesterday, 06:14 PM
        1 response
        11 views
        0 likes
        Last Post ラリー  
        Started by relogical, Yesterday, 05:20 PM
        0 responses
        15 views
        0 likes
        Last Post relogical  
        Started by vivekniwas, Yesterday, 05:11 PM
        0 responses
        12 views
        0 likes
        Last Post vivekniwas  
        Started by RookieKiwi, Yesterday, 03:38 PM
        2 responses
        23 views
        0 likes
        Last Post RookieKiwi  
        Working...
        X