Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 - Setting Enabled no longer possible to autostart strategies

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

    NT8 - Setting Enabled no longer possible to autostart strategies

    Hi

    In NT7 we could control programmatically the start/enabled state of a strategy...

    Part of this was simply possible by setting in the base class constructor:
    NT7.StrategyBase.Enabled=true

    In NT8 this has been replaced:
    However i am not as able to find a replacement for this in code...
    such as this.State=State.Start

    I don't want to start hacking around resorting to trapping the events from the strategy list where you set enabled=true and click OK..... etc

    Please can you add this or tell me a workaround etc or maybe reflection is the way...


    Really This is a vital piece of fuinctionality - For commercial usage and more professional or power usage of NinjaTrader imagine a scenario where...

    servers with NT7 are on trading with 100 realtime strategies in sim or live
    controlled by automation - (which would take many hours to stop and start.....manually)
    Typical workflow
    at end of week - close all positions shutdown NinjaTrader
    server data download and backup routines
    restart server
    start NT
    Kill off any model dialogues
    connect
    load workspace
    charts appear and strategies on the charts - startup
    if positions are flat or bound to etc -- autotrade can begin.. if not signal trade help desk.
    NT is ready to trade with the strategies on the market open...etc...

    This is vital for us if we are to move commercials into NT8

    many thanks

    Tom
    MicroTrends
    NinjaTrader Ecosystem Vendor - micro-trends.co.uk

    #2
    Just so we're clear based on information provided in another thread:

    There is an IsEnabled property so you could set in the desired State.

    However this would only work when configuring a strategy from a chart. The strategy tab of the control center works a bit differently and would need to be enabled from the grid... to my knowledge this was the same behavior as in NT7
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Matthew View Post
      Just so we're clear based on information provided in another thread:

      There is an IsEnabled property so you could set in the desired State.

      However this would only work when configuring a strategy from a chart. The strategy tab of the control center works a bit differently and would need to be enabled from the grid... to my knowledge this was the same behavior as in NT7

      Hi yes ofcourse IsEnabled + others prefixed very usefully in that is Group...

      In NT7 we used this to achieve automation on remote servers to negate the need for human intervention except when NT7 failed to load data - it allowed us to use commercial patterns and workflows for mechanical trading and testing.. which would be econonomical unviable - due to the required man hours - in parrallel... if this methodolgoy was removed from NT7 .. .we will try it and let you know...

      catering for commercials now will yield hugely in the future now NT8 can load data...

      thank you.

      tom
      MicroTrends
      NinjaTrader Ecosystem Vendor - micro-trends.co.uk

      Comment


        #4
        Originally posted by NinjaTrader_Matthew View Post
        Just so we're clear based on information provided in another thread:

        There is an IsEnabled property so you could set in the desired State.

        However this would only work when configuring a strategy from a chart. The strategy tab of the control center works a bit differently and would need to be enabled from the grid... to my knowledge this was the same behavior as in NT7
        Yes perfect! I need to read that document more ;-)

        I was very worried for a minute that this would not work as we have commercials waiting for a 360 degree service -which includes system and server automation including auto starting strategies etc...!

        The only caveat is that when the strategy was started by NT8 using the IsEnabled property in the strategy constructor - the indicators added in the strategy went into a new panel...
        Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


        so this would be a change from NT7 to NT8 - in NT7 there were no side effects doing this... any ideas can we report this as a glitch?
        MicroTrends
        NinjaTrader Ecosystem Vendor - micro-trends.co.uk

        Comment


          #5
          I wasn't able to reproduce.

          The indicators you reference, are they added through AddChartIndicator()?

          From the Constructor, are you simply adding IsEnable = true, or are you doing things with other properties and states?

          Here is a basic example I tested with, please let me know what I may need to change to replicate the behavior where the chart indicator does not get added to the desired panel

          Code:
          public class MyCustomStrategy2 : Strategy
          {
          	
          	public MyCustomStrategy2()
          	{
          		this.IsEnabled = true;	
          	}
          	protected override void OnStateChange()
          	{
          		if (State == State.SetDefaults)
          		{
          			Description					= @"Enter the description for your new custom Strategy here.";
          			Name						= "MyCustomStrategy2";			
          		}
          		else if (State == State.Configure)
          		{
          			AddChartIndicator(SMA(20));
          		}
          	}
          
          	protected override void OnBarUpdate()
          	{
          		//Add your custom strategy logic here.
          	}
          }
          MatthewNinjaTrader Product Management

          Comment


            #6
            Yes adding view pattern as shown...

            Add the strategies to a chart
            Save the workspace
            restart NT8 - with autoconnect datafeed

            indicator setting
            Description = @"MicroTrends Ultimate Stop and Reverse";
            Name = "MT.USAR";
            Calculate = Calculate.OnPriceChange;
            IsOverlay = true;
            DisplayInDataBox = true;
            DrawOnPricePanel = true;
            DrawHorizontalGridLines = true;
            DrawVerticalGridLines = true;
            PaintPriceMarkers = true;
            ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
            //Disable this property if your indicator requires custom values that cumulate with each new market data event.
            //See Help Guide for additional information.
            IsSuspendedWhileInactive = false;

            strategy


            video





            Code:
            public class MTUSARTrader : Strategy
            	{
            		private USAR  uSAR = new USAR();
            		
            		public MTUSARTrader()
            		{
            			/*this.State=State.SetDefaults;
            			this.State=State.Configure;
            			this.State=State.Active;
            			*/
            			IsEnabled=true;
            		}
            
            		protected override void OnStateChange()
            		{
            			if (State == State.SetDefaults)
            			{
            				Description	= "";
             				Name		= "MicroTrends USAR Trader";
            			}
            			else if (State == State.Configure)
            			{
            				uSAR = USAR(Input, uSAR.SignalMode, uSAR.CollisionMode, uSAR.Offset, uSAR.AVGPeriod, uSAR.ATRMultiplier, uSAR.ATRPeriod, uSAR.ATRSmoothing);
            				AddChartIndicator(uSAR);
            				
            			}
            		}
            
            	protected override void OnBarUpdate()
            		{
            			
            			
            			
            			if(CurrentBar<BarsRequiredToPlot)return; 
            			if (uSAR.SignalLong.IsValidDataPoint(0))
            			    EnterLong();
            			else if (uSAR.SignalShort.IsValidDataPoint(0))
            			    EnterShort();
            		}
            }
            Last edited by MicroTrends; 05-14-2015, 09:05 AM.
            MicroTrends
            NinjaTrader Ecosystem Vendor - micro-trends.co.uk

            Comment


              #7
              i updated the last post in cases you missed it
              MicroTrends
              NinjaTrader Ecosystem Vendor - micro-trends.co.uk

              Comment


                #8
                Thanks I was able to reproduce with those steps.

                For what it's worth at this time, if you're going to attempt to add this logic, I'd suggest at least double checking that the Account != null in the constructor before enabling-> it's currently causing issues on startup if not connected - which I will look into but cannot say for sure if that can/will be fixed.
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Originally posted by NinjaTrader_Matthew View Post
                  Thanks I was able to reproduce with those steps.

                  For what it's worth at this time, if you're going to attempt to add this logic, I'd suggest at least double checking that the Account != null in the constructor before enabling-> it's currently causing issues on startup if not connected - which I will look into but cannot say for sure if that can/will be fixed.
                  Yes all is connected - this is pretty vital functionality provided in NT7 ... if we are to bring commercials and the more serious algo trader/ analyst into the platform with a 360 automated service with NT8 as the choice// so would be great to get it working etc...

                  Maybe we can force the panels to be used programmatically.....
                  MicroTrends
                  NinjaTrader Ecosystem Vendor - micro-trends.co.uk

                  Comment


                    #10
                    We've been working on a similar issue in NTEIGHT-8146 which relates to this.
                    MatthewNinjaTrader Product Management

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by quantismo, 04-17-2024, 05:13 PM
                    3 responses
                    25 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by ScottWalsh, 04-16-2024, 04:29 PM
                    7 responses
                    34 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by cls71, Today, 04:45 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post cls71
                    by cls71
                     
                    Started by mjairg, 07-20-2023, 11:57 PM
                    3 responses
                    214 views
                    1 like
                    Last Post PaulMohn  
                    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                    4 responses
                    547 views
                    0 likes
                    Last Post PaulMohn  
                    Working...
                    X