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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        47 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        23 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        33 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Working...
        X