Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsArray - BarsInProgress

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

    #16
    Hello,

    thank you for your reply.

    When I understand right then your suggestion is the same as I have written now here in the last post(?)

    Thanks
    Tony

    Originally posted by borland View Post
    Adam,

    Things could be much easier if the BarsInProgress 'index' could optionally be put inside the brackets of the OnBarUpdate() method (e.g., OnBarUpdate(0)).

    That way you could eliminate the need to set up the IF conditional statement and just separate code under the appropriate call. Making it an option would maintain compatibility with existing code.

    Do you know if there are any other similarly called methods (OnExecution(), OnOrderUpdate(), OnStartup(), OnConnection) which have indexes. And also, how does the BarsInProgress index work inside these other methods?

    Comment


      #17
      @tony,

      if i understand adam correctly, he is saying this:
      - use && (BarsInProgress == 0) in your if statement surrounding each and every Action taken (enter short, exit long, etc.)
      - use additional conditions in your if statement, referencing any Bars[x] you like
      - do not include && (BarsInProgress == x) where x is any number other than 0
      - do not include && (BarsInProgress != 0)

      by including (BarsInProgress == 0), you are only firing your order execution for each incoming tick of the primary dataseries.

      @borland - that is a nice suggestion to add an overload to OnBarUpdate that will take an index.

      cheers,
      -e

      Comment


        #18
        Thanks Guys!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        316 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        202 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        187 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        282 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        234 views
        0 likes
        Last Post CarlTrading  
        Working...
        X