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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        57 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        78 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        39 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        101 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        61 views
        0 likes
        Last Post PaulMohn  
        Working...
        X