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

Having Template colour problems

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

    Having Template colour problems

    Hi

    Im modding an indicator so it changes colour based on a variable.

    The problem is that when i save as a template the colour change stops working

    here is my plot

    Code:
    Add(new Plot(new Pen(Color.Black, 2), PlotStyle.Line, "DairyValue"));
    here is my colour change

    Code:
    	
    			
    if(Mom>Mom1) 
    
    {
    PlotColors[4][0] = longColour1;
    } 
    
    else {
    PlotColors[4][0] = longColour2;
    				}
    			}
    this results in a line that changes colour based on whats happening.

    If i save this indicator as a template then it changes the lines back to black and blue with no colour changing.

    Any ideas.

    #2
    Thought this may help

    this is before i save as template



    if i save as template and then reload it looks like this....

    Comment


      #3
      Thanks for the screen shot, that does indeed help. I'm working to see if I can reproduce and resolve this behavior for you. Please expect an update shortly.
      MatthewNinjaTrader Product Management

      Comment


        #4
        I'm not able to reproduce this - are you saving it in a Chart Template, or saving the Indicator settings in a template (by right clicking on the Indicator properties, select "Set Default".

        Exact what changes are you making to the template?

        Would you be able to update a copy of your indicator and the xml template file? (Documents\NinjaTrader 7\Templates)
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by lucyjoy View Post
          Hi

          Im modding an indicator so it changes colour based on a variable.

          The problem is that when i save as a template the colour change stops working

          here is my plot

          Code:
          Add(new Plot(new Pen(Color.Black, 2), PlotStyle.Line, "DairyValue"));
          here is my colour change

          Code:
              
           
          if(Mom>Mom1) 
           
          {
          PlotColors[4][0] = longColour1;
          } 
           
          else {
          PlotColors[4][0] = longColour2;
                          }
                      }
          this results in a line that changes colour based on whats happening.

          If i save this indicator as a template then it changes the lines back to black and blue with no colour changing.

          Any ideas.
          Your code implies that longColour1 and longColour2 are Properties of the indicator. If so, you need to serialize them in order for them to be saved. Search the forum on the phrase, "serialize color": there are numerous threads on serializing colors.

          My most recent search gave me 14 threads. http://www.ninjatrader.com/support/f...archid=1452720

          Comment


            #6
            Nice one thanks...

            Who would have thought not having 1 line of code would do this...

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by arvidvanstaey, Today, 02:19 PM
            4 responses
            10 views
            0 likes
            Last Post arvidvanstaey  
            Started by samish18, 04-17-2024, 08:57 AM
            16 responses
            57 views
            0 likes
            Last Post samish18  
            Started by jordanq2, Today, 03:10 PM
            2 responses
            8 views
            0 likes
            Last Post jordanq2  
            Started by traderqz, Today, 12:06 AM
            10 responses
            18 views
            0 likes
            Last Post traderqz  
            Started by algospoke, 04-17-2024, 06:40 PM
            5 responses
            47 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X