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 judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        21 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X