Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsSinceEntryExecution with AdoptAccountPosition

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

    #16
    Originally posted by koganam View Post
    As I needed to myself personally check this out, AdoptAccountPosition itself being MY suggestion in the first place, I finally stopped theorizing and wrote a strategy to test this out.

    That stratetgy is attached to this post, and as you will see when you look in the Output Window, it perfectly tracks the number of bars of the last exit. If your code is not doing so, then you have a different problem: there is nothing wrong with what I suggested.
    koganam,

    Thank you for the strategy - it indeed works on my end and is very similar to what I have. My issue as I've discovered was my interpretation of how OnExecutionUpdate() worked. I assumed it would catch the event of the strategy "adopting" my account position. I was wrong. It purely catches the event when the trade was originally placed, which brings me to where my issue was - my strategy was real-time only. Once I included historical data, it worked as you described. Thank you again.

    So for the past week I've been attempting to make AdoptAccountPosition work for my needs (strategy recognizes its strategy-generated position upon re-enable), but now am wondering if there is another way to achieve the same result. If you don't mind me asking koganam, which starting behavior do you use? I'm beginning to research and test the others, but would value any inputs you may have.

    Comment


      #17
      Originally posted by ak5745 View Post
      koganam,

      Thank you for the strategy - it indeed works on my end and is very similar to what I have. My issue as I've discovered was my interpretation of how OnExecutionUpdate() worked. I assumed it would catch the event of the strategy "adopting" my account position. I was wrong. It purely catches the event when the trade was originally placed, which brings me to where my issue was - my strategy was real-time only. Once I included historical data, it worked as you described. Thank you again.

      So for the past week I've been attempting to make AdoptAccountPosition work for my needs (strategy recognizes its strategy-generated position upon re-enable), but now am wondering if there is another way to achieve the same result. If you don't mind me asking koganam, which starting behavior do you use? I'm beginning to research and test the others, but would value any inputs you may have.
      I prefer to use AdoptAccountPosition at all times. That is why I suggested it as a NT8 facility in the first place.

      I did have some settings finagled in NT7, that approximated the ability to try to sync to the account position, with some manual intervention as necessary. So far AdoptAccountPosition seems to be everything that I had hoped for, but there is time yet left before we get to the release version. We shall have to wait and see what gives.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by r68cervera, 04-25-2024, 05:29 AM
      2 responses
      15 views
      0 likes
      Last Post r68cervera  
      Started by SugarDefHealth, Today, 03:30 AM
      0 responses
      2 views
      0 likes
      Last Post SugarDefHealth  
      Started by ETFVoyageur, Today, 02:08 AM
      1 response
      7 views
      0 likes
      Last Post ETFVoyageur  
      Started by kujista, 04-22-2024, 07:46 AM
      3 responses
      12 views
      0 likes
      Last Post kujista
      by kujista
       
      Started by kujista, 04-23-2024, 06:23 AM
      7 responses
      57 views
      0 likes
      Last Post kujista
      by kujista
       
      Working...
      X