Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Not closing of orders after Stop

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

    Not closing of orders after Stop

    Hello good afternoon.

    I have a problem, I have a well defined strategy with entry, stop and target. For example, if the defined parameters are true, the entry is made with (2 contracts), also defining the stop and target with (2 contracts).

    But the problem faced is that when going to the stop the entry is canceled correctly but it remains only (1 contract) of the target remains active and I have to close it manually.

    Below I made the code available via Google Drive, would you have any idea what might be happening?

    Thanks in advance for your help.
    Last edited by WenisCR; 04-05-2023, 12:49 PM.

    #2
    Hello, thanks for writing in. The first adjustment you should make to this strategy is not using "EntryOrder" for both your long and short entries. Make a separate "EntryOrder" for long or short entries. I am not going to debug this script, but I am thinking the issue you are seeing is coming from mixing up orders in this way. I tested the OnOrderUpdate example that we have by simply changing the entry order quantity to 2 and this is working fine:

    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris, how are you doing?
      Got it, thanks for the info and even more for the correction tip. I'll test it and report back.
      Thanks a lot for the help.​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by chrischongpdx, Today, 09:39 PM
      0 responses
      7 views
      0 likes
      Last Post chrischongpdx  
      Started by Mountain_cast, Today, 12:41 PM
      2 responses
      9 views
      0 likes
      Last Post Mountain_cast  
      Started by dontpanic, 04-07-2015, 04:42 AM
      4 responses
      1,322 views
      0 likes
      Last Post BeachTrader11807  
      Started by algospoke, Today, 07:54 PM
      0 responses
      5 views
      0 likes
      Last Post algospoke  
      Started by Rxxar, Today, 06:26 PM
      0 responses
      10 views
      0 likes
      Last Post Rxxar
      by Rxxar
       
      Working...
      X