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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        117 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        166 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        85 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        130 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        88 views
        0 likes
        Last Post PaulMohn  
        Working...
        X