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 funk10101, Today, 09:43 PM
          0 responses
          6 views
          0 likes
          Last Post funk10101  
          Started by pkefal, 04-11-2024, 07:39 AM
          11 responses
          37 views
          0 likes
          Last Post jeronymite  
          Started by bill2023, Yesterday, 08:51 AM
          8 responses
          44 views
          0 likes
          Last Post bill2023  
          Started by yertle, Today, 08:38 AM
          6 responses
          26 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Started by algospoke, Yesterday, 06:40 PM
          2 responses
          24 views
          0 likes
          Last Post algospoke  
          Working...
          X