Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

new order overlaps settrailstop close ?

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

    new order overlaps settrailstop close ?

    Hello, i am testing a simple strategy based in SampleMACrossOver and i had some problems when settrailstop long close position and inmediatly a short position was created.

    The platform sent 2 short positions but the strategy programming only want to send 1. Whats happend?

    The CalculateOnBarClose is initialize to false but, when i send an order i test if the if(Position.MarketPosition.ToString() != "Long" or "Short" ...

    I think musnt entry 2 times...


    I attached 2 images and the .cs file.






    Attached Files

    #2
    marynja, it would definitely send 2 in the managed approach to reverse you with the EnterMethods. You're closing out the prior long (1 qty) and entering the new short (1qty). This means you're net short 1 contract, as the other one is needed to offset the prior long.

    Comment


      #3
      Hello Bertrand, thank you.

      This error is strange, dont happends all the times, then i think there are something more.

      Could you help me whats the best and more safe method for launch orders in strategies?

      Thank you again.

      Comment


        #4
        marynja, the behavior you describe would be expected for the Enter() methods in the managed approach. If you don't want them to reverse for you, then for example working in the more advanced unmanaged approach would be ideal, here you directly just execute the qty you specify in your SubmitOrder call via the script.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        646 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        367 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X