Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    Brandon H.NinjaTrader Customer Service

    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.

        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,404 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        95 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        7 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        159 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        8 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X