Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Draw immediately on first tick of day

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

    How to Draw immediately on first tick of day

    my chart is 5min time frame
    How do I draw a simple line immediately when the trading session starts on the first tick of day, when I know what is the OPEN of that day ?
    I know I can run on every tick. but I dont want to overload the operation. I only need that one single tick of start of day . thats it .


    #2
    Hello dadarara,

    Thanks for your post.

    You could create an indicator that uses Calculate.OnEachTick, create a condition in your script that checks if Bars.IsFirstBarOfSession and checks if IsFirstTickOfBar, and call your Draw method such as Draw.HorizontalLine() within that condition.

    See the help guide documentation below for more information.

    Calculate: https://ninjatrader.com/support/help.../calculate.htm
    IsFirstBarOfSession: https://ninjatrader.com/support/help...rofsession.htm
    IsFirstTickOfBar: https://ninjatrader.com/support/help...ttickofbar.htm
    Draw Methods: https://ninjatrader.com/support/help...t8/drawing.htm
    Draw.HorizontalLine(): https://ninjatrader.com/support/help...zontalline.htm

    Note that the CurrentDayOHL indicator that comes default with NinjaTrader could also be used to get the Open of the current day.

    CurrentDayOHL: https://ninjatrader.com/support/help...nt_day_ohl.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      as I asked in my original question : is there any way to do this WITHOUT running the indicator on each TICK ?

      Comment


        #4
        Hello dadarara,

        You would need OnEachTick calculation to be able to detect when the first tick happens, when using OnBarClose you work with bar close events only.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        571 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X