Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Complex properties/parameters

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

    Complex properties/parameters

    Settings for complex properties are not saved/used.

    Property code:
    Code:
        private OrderParameters _orderParameters = new OrderParameters();
     
        [Category("Order Handling")]
        [Gui.Design.DisplayName("ATM Parameters")]
        public OrderParameters ATMParameters
        {
            get { return _orderParameters; }
        }
    Part of the OrderParameters class code:
    Code:
        [TypeConverter(typeof(ExpandableObjectConverter))]
        public class OrderParameters
        {
            private int _profitTarget = 0;
            private int _stopLoss = 0;
            private bool _simulateStopOrders = false;
     
            private AutoBreakeven  _autoBreakeven = new AutoBreakeven();
            private List<AutoTrail> _autoTrail = new List<AutoTrail>(3);
     
            [Description("Gets or sets the initial stop loss.")]
            [Category("Parameters")]
            public int StopLoss
            {
                get { return _stopLoss; }
                set { _stopLoss = value; }
            }
     
            [Description("Gets or sets the profit target.")]
            [Category("Parameters")]
            public int ProfitTarget
            {
                get { return _profitTarget; }
                set { _profitTarget = value; }
            }
     
            [Description("Indicates whether to simulate stop orders.")]
            [Category("Parameters")]
            public bool SimulateStopOrders
            {
                get { return _simulateStopOrders; }
                set { _simulateStopOrders = value; }
            }
     
            [Category("Parameters")]
            public AutoBreakeven AutoBreakeven
            {
                get { return _autoBreakeven; }
            }
     
            public override string ToString()
            {
                return string.Format("SL: {0}{1}, TP: {2}", _stopLoss, _simulateStopOrders ? " (simulated)" : "", _profitTarget);
            }
        }
    All settings for the property ATMParameters are lost when I start the strategy, instead the default values are used (in this case SL:0, TP:0, ...). Any workaround?

    Another issue is, that these values are not optimizable. Hopefully this will be changed soon.

    Regards,
    Daniel
    Last edited by Buthus; 11-07-2009, 11:37 AM.

    #2
    NT only supports the parameters types supported by the strategy wizard (double/int/bool/string). Anything else is not supported and may or may not work.

    Comment


      #3
      Hello Dierk,

      is there any method that is called after the properties dialog is closed, so that I can store the settings and load them again when the strategy is actually started?

      Regards,
      Daniel

      Comment


        #4
        Unfortunately this is beyond what we could provide support for.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        60 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        147 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        284 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X