Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by elirion, Today, 01:36 AM
    0 responses
    3 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by gentlebenthebear, Today, 01:30 AM
    0 responses
    3 views
    0 likes
    Last Post gentlebenthebear  
    Started by samish18, Yesterday, 08:31 AM
    2 responses
    9 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by Mestor, 03-10-2023, 01:50 AM
    16 responses
    389 views
    0 likes
    Last Post z.franck  
    Started by rtwave, 04-12-2024, 09:30 AM
    4 responses
    34 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Working...
    X