Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Brush field in Strategy Analyzer

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

  • NinjaTrader_AlanP
    replied
    Hello glivv,

    Thank you for your patience.

    The solution as of now is to use a solid brush color.

    I have attached a script which will hold its color.

    Code:
    [XmlIgnore()]
    		[Display(Name = "FillBrush", GroupName = "NinjaScriptParameters", Order = 1)]
    		public SolidColorBrush FillBrush
    		{ get; set; }		
    		
    		[Browsable(false)]
    		public string FillBrushSerialize
    		{
    			get { return Serialize.BrushToString(FillBrush); }
       			set { FillBrush = (SolidColorBrush)Serialize.StringToBrush(value); }
    		}
    Please let us know if you need further assistance.
    Attached Files

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello glivv,

    This bug is assigned an ID of, 12485, which you can check the helpguide for under the release notes at the following link,


    I wouldn't be able to say when its slated to be fixed however if you check the release notes in the next release you may find that number...

    Please let us know if you need further assistance.

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello glivv,

    Thank you for your patience.

    I have reported this as a bug and will follow up with you when I have more information.

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Helllo glivv,

    I am currently looking into this and will follow up when I have more information.

    Thank you for your patience.

    Leave a comment:


  • glivv
    replied
    Hello Allan

    even if I use code per your suggestions, i.e.:

    Code:
    namespace NinjaTrader.NinjaScript.Strategies
    {
    	public class TstBrush : Strategy
    	{
    		private	Brush boxColor = Brushes.Green;
    		
    		[XmlIgnore()]
    		[NinjaScriptProperty]
    		[Display(Description = "BoxColor", GroupName = "Parameters", Order = 4)]
    		public Brush BoxColor
    		{
    			get{return boxColor;}
    			set{boxColor = value;}
    		}
    		
    		[Browsable(false)]
    		public string BoxColorBelowSerialize
    		{
    			get{return Serialize.BrushToString(boxColor);}
    			set{boxColor = Serialize.StringToBrush(value);}
    		}
    		
    		protected override void OnStateChange()
    		{
    		}
    	}
    }
    I still see that BoxColor input is reverted back to default value after run in Strategy Analyzer.

    That is, open Strategy Analyzer, choose TstBrush strategy, change BoxColor from Green to any other value, White for example, select symbol/timeframe/period and press Run. When backtest finishes, BoxColor input is reverted to Green. It doesn't stay at White.

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello glivv,

    If you add the print statement in the screen shot within SetDefaults and open an output window, then pull up a strategy analyzer and queue up the strategy, run the analyzer, you will see how often this block is ran. Setting the value within SetDefaults is going to cause the brush to be set back to this value.

    You should set the value of the brush outside of State.SetDefaults.

    Please let us know if you need further assistance.
    Attached Files

    Leave a comment:


  • glivv
    replied
    So, unlike any other (like integer or string) properties, Brush property cannot be set in "State == State.SetDefaults" branch in OnStateChange()?

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello glivv,

    Thank you for your note.

    I revised your script and provided the correct way to go about taking a brush input as well as serializing it.

    Code:
    private	Brush boxColor = Brushes.Green;
    		
    		[XmlIgnore()]
    		[NinjaScriptProperty]
    		[Display(Description = "BoxColor", GroupName = "Parameters", Order = 4)]
    		public Brush BoxColor
    		{
    			get{return boxColor;}
    			set{boxColor = value;}
    		}
    		
    		[Browsable(false)]
    		public string BoxColorBelowSerialize
    		{
    			get{return Serialize.BrushToString(boxColor);}
    			set{boxColor = Serialize.StringToBrush(value);}
    		}
    Please let us know if you need further assistance.
    Attached Files

    Leave a comment:


  • glivv
    started a topic Brush field in Strategy Analyzer

    Brush field in Strategy Analyzer

    Hi,

    I'm having problem with Brush field resetting to default value after run in Strategy Analyzer.

    See attached sample strategy.

    I open Strategy Analyzer window, change integer and Brush values (before_pressing_run screenshot) and press Run. After completion (after_pressing_run screenshot) integer value stays but Brush value reverts to default one.

    What am I doing wrong?
    Attached Files

Latest Posts

Collapse

Topics Statistics Last Post
Started by Thomas79, Today, 02:02 AM
3 responses
9 views
0 likes
Last Post NinjaTrader_Jesse  
Started by waltFX, Today, 06:26 AM
1 response
9 views
0 likes
Last Post NinjaTrader_Gaby  
Started by Powerbucker, Today, 03:13 AM
2 responses
15 views
0 likes
Last Post NinjaTrader_Jesse  
Started by ReneRose, Yesterday, 09:55 AM
4 responses
20 views
0 likes
Last Post NinjaTrader_Jesse  
Started by zehua, Yesterday, 10:28 PM
2 responses
13 views
0 likes
Last Post NinjaTrader_Gaby  
Working...
X