• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 Zuhier Dourgham, Today, 03:55 AM
        0 responses
        3 views
        0 likes
        Last Post Zuhier Dourgham  
        Started by JorgeDamien, Today, 03:47 AM
        0 responses
        1 view
        0 likes
        Last Post JorgeDamien  
        Started by jefferyfrench, Today, 03:45 AM
        0 responses
        2 views
        0 likes
        Last Post jefferyfrench  
        Started by alberts, Yesterday, 09:50 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by VincentMicah, Today, 12:46 AM
        0 responses
        3 views
        0 likes
        Last Post VincentMicah  
        Working...
        X