• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

first tick of bar

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

    first tick of bar

    I am having an issue with first tick of bar. I am not sure if I am doing it correctly.

    protected override void Initialize()
    {
    Overlay = true;
    CalculateOnBarClose = false ;

    }


    /// </summary>
    protected override void OnBarUpdate()
    {

    if (CurrentBar == Bars.Count - 2)
    {
    int nCount = this.list.Count;
    bool bPriceFound = false;

    if (FirstTickOfBar == true)
    {
    // print my information
    }
    else
    {
    // collect information
    }


    the issue is it is always printing and never collecting information. It never goes to the the else statement

    }

    #2
    Hello ballboy11,

    Thank you for your note.

    When a bar is first created the open of that bar is the first tick of that bar, so every bar should meet your condition.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      I understand but on a minute chart or a 5 minute etc it is still going through the firsttickof bar everytick

      if (FirstTickOfBar == true)
      {


      Print("in first tick of bar " + Time[0]);
      }


      look at the picture below on the output this is on a 1 minute chart
      Attached Files

      Comment


        #4
        Hello ballboy11,

        May I confirm that the output window you've shared a picture of is a minute chart rather than a tick chart? I am unable to replicate with a minute chart but when I use a tick chart my results match what you've posted.

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jshapen, Yesterday, 06:35 PM
        0 responses
        8 views
        0 likes
        Last Post jshapen
        by jshapen
         
        Started by leocrespo, 11-06-2015, 01:48 AM
        5 responses
        1,767 views
        0 likes
        Last Post nkhoi
        by nkhoi
         
        Started by NT8Newbie, Yesterday, 12:49 PM
        0 responses
        16 views
        0 likes
        Last Post NT8Newbie  
        Started by pdennis, Yesterday, 11:43 AM
        0 responses
        5 views
        0 likes
        Last Post pdennis
        by pdennis
         
        Started by Duval, Yesterday, 08:38 AM
        0 responses
        17 views
        0 likes
        Last Post Duval
        by Duval
         
        Working...
        X