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 ageeholdings, Today, 07:43 AM
        0 responses
        7 views
        0 likes
        Last Post ageeholdings  
        Started by pibrew, Today, 06:37 AM
        0 responses
        4 views
        0 likes
        Last Post pibrew
        by pibrew
         
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        12 views
        0 likes
        Last Post burtoninlondon  
        Working...
        X