Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 chbruno, Today, 04:10 PM
        0 responses
        3 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        6 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by frslvr, 04-11-2024, 07:26 AM
        9 responses
        127 views
        1 like
        Last Post caryc123  
        Working...
        X