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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        67 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X