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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        70 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        42 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        25 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        28 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        54 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X