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

need help with this paintbar

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

    need help with this paintbar

    hi,

    which line of code would i need so all my paintbars start only after the first bar of the first session (e.g. 930 am EST)

    i basically don't like how it plots paintbar at the first bar of the session, would like it to start at the bar #2

    attached is my code

    thanks
    Attached Files

    #2
    Hello qitrader,

    You may use the "Bars.FirstBarOfSession" to see if it is the first bar of the Session that your Indicator is placed on automatically.

    So you may add something before your conditions like:

    if(Bars.FirstBarOfSession) return;

    Otherwise you may define a time manually by using the ToTime() method like:

    // Checks to see if the time is past 9:30 AM. Time format is going to be military HHMMSS format.
    if (ToTime(Time[0]) > 093000 )
    {
    // Do something.
    }

    You may see the following thread for an example of how to use time filters.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by trilliantrader, Today, 03:01 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by geddyisodin, Today, 05:20 AM
    6 responses
    34 views
    0 likes
    Last Post geddyisodin  
    Started by pechtri, 06-22-2023, 02:31 AM
    9 responses
    122 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by frankthearm, 04-18-2024, 09:08 AM
    16 responses
    67 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by habeebft, Today, 01:18 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X