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

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 Austiner87, Today, 03:42 PM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by cshox, Today, 11:11 AM
        2 responses
        16 views
        0 likes
        Last Post cshox
        by cshox
         
        Started by algospoke, Today, 06:53 PM
        0 responses
        11 views
        0 likes
        Last Post algospoke  
        Started by mlprice12, 12-21-2021, 04:55 PM
        3 responses
        298 views
        0 likes
        Last Post paypachaysa  
        Started by lorem, 04-25-2024, 09:18 AM
        20 responses
        87 views
        0 likes
        Last Post lorem
        by lorem
         
        Working...
        X