Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why there are two orders filled when I use EnterShortLimit

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

    Why there are two orders filled when I use EnterShortLimit

    HI Ninjatrader Engineers,

    I met an issue when I use EnterShortLimit in script editor. I found when the script is running, there are two orders filled but the quantity I set is 1. I then checked the order lists and log. I found one order is what I expect with "Sell short" action type but the other order's action type is "Sell". I screenshot the log and order lists. Could you please explain this and tell me how to submit 1 order only? Thanks!
    Here is the format I'm using: EnterShortLimit(1, Close[0], @"Long1");


    Click image for larger version  Name:	image.png Views:	0 Size:	12.8 KB ID:	1286619Click image for larger version  Name:	image.png Views:	0 Size:	64.4 KB ID:	1286620​​
    Last edited by AndrewDu; 01-16-2024, 12:09 AM.

    #2
    Hello AndrewDu,

    Thank you for your post.

    Based on your screenshots, you are using NinjaTrader 8. This was initially posted in the NinjaTrader 7 section of the forum; I have moved it to the NinjaTrader Desktop topic, which is relevant for NinjaTrader 8. In the future, please be sure to post your new threads in the most relevant topic. Thank you for your understanding.

    With that said, I see that the order with the 'Sell' action is named "Close position" and the order with the 'Sell short' action is named "Long1." They are both limit orders; one appears to be set up for closing a long position and the other is for opening a short position. I suggest using print statements and enabling TraceOrders in your strategy for more information to help understand and debug your strategy's behavior. For more information on these tools, please see the links below:If you do not understand the output after adding prints and enabling trace orders, please save it by right-clicking the NinjaScript Output window and selecting Save As. Then you will save a text file that can be attached to your response. If you need assistance with creating print statements in your strategy, please share a snippet of your code, such as the conditions that result in the order Long1, and I would be glad to provide you with an example of a print statement you could test out.

    Please let us know if we may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    549 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X