Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Enter a Limit Order Trade?

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

    How to Enter a Limit Order Trade?

    I'm having problems entering a limit order.

    Right after this bar closes (at 2055.25), I want to enter a limit trade, to enter at 2055.50, one tick past the close of the bar. I've tried each of these calls:

    myEntryOrder = EnterLongStopLimit(High[1] + (1 * TickSize), High[1], "SMA Cross Entry");
    myEntryOrder = EnterLongLimit(High[1] + (1 * TickSize));
    myEntryOrder = EnterLongStop(High[1] + (1 * TickSize));

    The value of (High[1] + (1 * TickSize)) is properly calculated to be 2055.50; however, I keep getting entered on the trade (when simming) at 2055.25, not 2055.50 where I want to enter my long.

    How to fix? Thanks
    Attached Files

    #2
    Hello timmbo,

    Thanks for opening the thread.

    When you are referencing High[1], you are referencing the high of the previous bar.

    If you would like to place a limit order one tick above the closing price of the current bar, I suggest to use Close[0] instead of High[1].

    I would advise to place print statements of the High[1] and Close[0] when you submit the order, so you can see the price when the order submits within the NinjaScript Output window.

    I also suggest to use Trace Orders within your strategy so you can monitor order submissions and see what is happening within the script.

    Debugging tips on using TraceOrders and Print() statements can be found below:


    Please let me know if you have any additional questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    51 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X