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 helpwanted, Today, 03:06 AM
    1 response
    14 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    11 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    6 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    244 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    387 views
    1 like
    Last Post Gavini
    by Gavini
     
    Working...
    X