Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Missing indicators when exporting strategy

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

    Missing indicators when exporting strategy

    Hi,
    I've created a simple Strategy with an Indicator (eg. EMA). Now I want to export this strategy using Tools -> Export -> NinjaScript. When I click add, in Select window I can see some References and my Strategies, but there are no Indicators (Type - All) and Type - Indicators tab is empty. I can't export strategy without indicator used in the strategy's code. Am I missing something?
    I'm using freshly installed NinjaTrader 8 Beta 5.

    #2
    Hello InteRadek,

    Can you please set Type to 'System indicators' instead of 'Indicators' and you should see the EMA.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Thanks Jason, I feel silly for not notice it.

      Could you also tell me, where in NT8 can I find an ID of a strategy? An equivalent of "this.Id" in NT7 (what returns -1 in NT8).

      Comment


        #4
        Hello InteRadek,

        I would suggest checking for the strategy's ID in the OnBarUpdate() method.

        If you are assigning this value to a variable, for example, you could use a boolean statement to only assign the ID to the variable only one time, rather than on every OnBarUpdate() call.

        Example:
        Code:
        private bool obtainedID = false;
        private int theID = 0;
        
        protected override void OnBarUpdate()
        {
             if (!obtainedID)
             {
                  theID = this.Id;
                  obtainedID = true;
             }
        }
        Zachary G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,789 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        837 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,293 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        13 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        63 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X