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 rajendrasubedi2023, Today, 09:50 AM
    0 responses
    9 views
    0 likes
    Last Post rajendrasubedi2023  
    Started by ender_wiggum, Today, 09:50 AM
    0 responses
    4 views
    0 likes
    Last Post ender_wiggum  
    Started by bmartz, Today, 09:30 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by geddyisodin, Today, 05:20 AM
    3 responses
    24 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by lorem, Today, 09:18 AM
    1 response
    5 views
    0 likes
    Last Post lorem
    by lorem
     
    Working...
    X