Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calling the Ticks index when optimizing

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

    Calling the Ticks index when optimizing

    Hi Ninjas,

    Maybe this question is answered very simply or it can't:

    When I'm performing an optimization, the Strategy Analyzer has its own count by ticks, seconds...etc What I'd like to know is: HOW CAN I CALL INTO A CODE THE ACTUAL INTERNAL PERIOD (TICKS, SECONDS..ETC) THAT IS BEING USED EVENTUALLY IN THE OPTIMIZATION PROCESS?

    Imagine for a second that I'd like to know that your code must be able to call that number to keep an internal counter, got it?

    As always your attention will be appreciated.

    #2
    Hello pstrusi,
    You can get the bar id and bar value from the BarsPeriod object.

    Please refer to our help guide to know more about it.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi again Ninjas,

      The earlier suggestion, despite it's useful still doesn't solve what I need.

      What I want is using the actual "integer number" calling Bars.Period.Id (within an optimization) to use it like this: Add("$EURUSD", PeriodType.Tick, Bars.Period.Id ) but this brings an error out.

      What I need is dynamically change the sentence Add("$EURUSD", PeriodType.Tick, Bars.Period.Id ) in the Initialize section.

      I imagine this can't be, so how I do a similar process? any suggestion?

      Thanks

      Comment


        #4
        Hello pstrusi,
        You can use the below code:

        Code:
        Add("$EURUSD", BarsPeriod.Id, BarsPeriod.Value );
        However please note it is not supported and can cause unexpected results due to race conditions.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X