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.

    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.

        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?

            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Christopher_R, Today, 12:29 AM
            0 responses
            8 views
            0 likes
            Last Post Christopher_R  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            166 responses
            2,235 views
            0 likes
            Last Post sidlercom80  
            Started by thread, Yesterday, 11:58 PM
            0 responses
            3 views
            0 likes
            Last Post thread
            by thread
             
            Started by jclose, Yesterday, 09:37 PM
            0 responses
            7 views
            0 likes
            Last Post jclose
            by jclose
             
            Started by WeyldFalcon, 08-07-2020, 06:13 AM
            10 responses
            1,415 views
            0 likes
            Last Post Traderontheroad  
            Working...
            X