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

Bar Time based test

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

    Bar Time based test

    Ok I am trying to convert my NJ7 indicator to NJ8 and I am struggling with a bar Time test.

    In NJ7 I had captured a bar time value by using

    barIWantTheTimeOf.Set(Time[1]);

    which was declared in Initalize using

    private DateTimeSeries barIWantTheTimeOf;

    Then I was using the hour period of that captured time like this.

    if(Time.Hour[0] > barIWantTheTimeOf[0].Hour && Time.Hour[0] > (barIWantTheTimeOf[0].Hour +5)) {do something}

    As the set function has been replaced in NJ8 with something else my NJ7 code does not work.

    I have gone through the NJ8 manual but I am not seeing the alternative approach.

    Help please.

    #2
    Hello EastLondonKiwi, and thank you for your question. Any time you saw

    Code:
    Series.Set(Value)
    You can replace this with

    Code:
    Series[0] = Value
    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Jessica

      would you mind using my example and coding the correct Nj8 alternatives

      Thanks

      Comment


        #4
        Attached is a code sample that accomplishes this goal. Code samples we provide are for educational purposes, and are not intended for live trading, and are not guaranteed to accomplish any user goal or to be maintained.
        Attached Files
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Jessica you are a star.

          Thanks

          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