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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 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
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X