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.

    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 Mindset, Yesterday, 06:46 AM
        0 responses
        14 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        25 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        16 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        82 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        51 views
        0 likes
        Last Post PaulMohn  
        Working...
        X