Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simultaneous entry and exit stopping strategy

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

    Simultaneous entry and exit stopping strategy

    I have a situation where an entry occurs at the same time another exit occurs and this seems to be causing a conflict which stops the strategy from taking any more trades. Pictures included.

    logic for my exits and entries is as follows:

    when Position.Quantity = 3000 and (condition) exit long 2000

    when Position.Quantity = 9000 and (condition) exit long 6000

    I want to force them to occur consecutively not at the same time. It seems that when the first condition is met and exits 2000 first when in fact I want it to exit the 6000 first. By exiting backwards the exit condition defined by position.quantity is not ever met since it's looking for a value of 9000.

    Any ideas on how to work around this?
    Attached Files

    #2
    Hello ShruggedAtlas,

    Thanks for the post.

    It is hard to say exactly what could be wrong without code snippets, but you might need to set up some boolean flags to be used in concert with your entry/exit conditions. You would set the flag to inhibit the larger position from exiting before the smaller one.

    If you still experience the issue after setting this up please post some code snippets from OnBarUpate and I will take a look.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      That may very well be that I would need to get down to the code but I'm not sure why I can't do this using just the strategy builder wizard. I've included a couple of pictures to show more clearly what I want to happen.

      after LE3 exits, LE2 should exit but it doesn't exit until after L3 enters and exits two more time. I don't understand why it isn't exiting after the first time.


      OK I THINK I GOT IT

      Changing cross.above to greater fixes the problem
      Attached Files
      Last edited by ShruggedAtlas; 05-25-2018, 11:08 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by toughiee, Today, 12:04 AM
      0 responses
      2 views
      0 likes
      Last Post toughiee  
      Started by vdoan20, Yesterday, 08:30 PM
      0 responses
      7 views
      0 likes
      Last Post vdoan20
      by vdoan20
       
      Started by gupagoer, Yesterday, 07:42 PM
      0 responses
      9 views
      0 likes
      Last Post gupagoer  
      Started by Holligoly, Yesterday, 05:13 PM
      2 responses
      11 views
      0 likes
      Last Post Holligoly  
      Started by Raginpower, Yesterday, 01:53 PM
      0 responses
      14 views
      0 likes
      Last Post Raginpower  
      Working...
      X