• 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

Catch the end of a minute bar on a tick by tick OnBarUpdate event

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

    Catch the end of a minute bar on a tick by tick OnBarUpdate event

    I was wondering if there is a way to catch the end of a minute bar when updating a strategy on a tick per tick basis?

    I explain:

    protectedoverridevoid Initialize()
    {
    ....
    Add(PeriodType.Minute,
    1);

    CalculateOnBarClose =
    false;

    }

    #2
    No, since the end of the bar only would be determined as the first tick of the new bar was seen.

    BTW: No need for
    Add(PeriodType.Minute,1);
    Just execute your strategy on a 1 minute series.
    DierkNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      No, since the end of the bar only would be determined as the first tick of the new bar was seen.

      Although, we are using tick to fire the OnBarUpdate event I thought there could have been a special event, a time event that could indicate the end of a bar even when there is not a new coming tick, something like:

      OnBarUpdate.UpdateType = NewTick

      or

      OnBarUpdate.UpdateType = EndBarContext(ContextNumber)

      Sometimes like this.

      Basically it would be nice to have different types of events that could trigger the OnBarUpdate event and then be able to check the type of events which triggered the OnBarUpdate event.

      It would be very helpfull to write fast accurate trading strategies.

      BTW: No need for
      Add(PeriodType.Minute,1);
      Just execute your strategy on a 1 minute series.
      I cannot do that as my strategies have limit orders but I want those orders to become market after a small time has passed or few quotations have occured. So I need to track down at the tick level my entry limit in the market to check if it was quoted or not.

      Knowing the end of the bar of a given context before the first tick of the next bar would be handy to update my entry or exit trigger one tick earlier.

      Thanks,
      Fabrice.

      Comment


        #4
        Thanks for your suggestion. We'll add it to the list.
        DierkNinjaTrader Customer Service

        Comment


          #5
          Fabrice,

          Maybe is it possible to retrieve the time remaining from the indicator BarTimer. ( I do not know how to do it)

          Comment


            #6
            This is not possible.

            Maybe PercentComplete would work?

            http://www.ninjatrader-support.com/H...tComplete.html
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ahadari28, Today, 04:01 PM
            0 responses
            1 view
            0 likes
            Last Post ahadari28  
            Started by TazoTodua, Today, 06:00 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by TazoTodua, Today, 09:06 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by gbux11, Today, 02:36 AM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by NinjaCustomer, 05-09-2019, 08:54 AM
            4 responses
            67 views
            0 likes
            Last Post Harry
            by Harry
             
            Working...
            X