Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

5min chart, AddNewPlot based of a closes at a specific time

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

    5min chart, AddNewPlot based of a closes at a specific time

    Hello Ninja Support and Ninja Traders,

    How do I call on the 3:15am candle specifically?

    "Calling on this specific time based candle to AddNewPlot at its closing price"

    I am in Asia the futures market reopens at 6am I am wanting to add a horizontal line at the start of the market
    based on the closing price of the 3:15am candle.

    Ninja Support and Personal users, shout out to "Forrestang", have both helped me here to understand ninja script better
    I understand Ninja Support cant write code for me but if someone could scratch together an example
    of how it would be structured It would be so very helpful


    I haven't posted here for a long time I have been using Ninja help guides for about 2 months on this but I cant figure it out.

    Kind Regards Chris

    #2
    Hello Chris,

    Is this a 1 minute or 5 minute or 15 minute chart?

    You can compare the bar time to be 3:15.

    if (ToTime(Time[0]) == 31500))

    Or if you are trying to get a bar number from the most recent bar at 3:15 you can use Bars.GetBar().

    Print("Bar number at 3:15: " + Bars.GetBar(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 3, 15)));
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      it a 5min chart,
      I'm getting the 3:15am bar closing price,
      attaching my plot line to that closePrice


      // get the close price of the 3:15am Candle
      double closePrice = Print("The close price on the 3:15 AM bar was " + Bars.GetClose(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 3, 15)));

      Is this correct?

      thank you Chelsea

      Comment


        #4
        Hello Chris,

        This would be correct for finding the the 3:15 bar that occurred on the same day.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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
        554 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