Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterShortStopLimit() can be used like a pending order?

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

    EnterShortStopLimit() can be used like a pending order?

    Hi Im try with my strategy to place a "pending" or a waiting order in the market , like when we place a manual order on the chart, for example , in my Close[1]>Open[5] , place a short order position on Open[5]-1*TickSize that is the price where I want to place my order, but when Im Testing the strategy in market replay I didnt see the order on the chart just if the close[0] close below Open[5] but the problem is if the close[0] close 10 tick below the Open[5] the order is placed there or I get the error sell stop or sell stop limit cant be place above the market, IDK if the problem is for the market replay that the Close[0] is the "Actual" Price or How can I solved , I wan just place the order on the price that I want and taked on that price, Thanks A lot!
    This problem is fixed on realtime data ?

    TGT
    Attached Files

    #2
    Hello FernandoParra,

    Thanks for your post.

    Yes, EnterShortStopLimit() could be used to place a sell short stop limit order to enter a short position.

    When running the strategy with Calculate.OnBarClose, the Close[0] value refers to the Close price of the bar that just closed. Calculate.OnBarClose means that OnBarUpdate logic will process only at the close of each bar.

    Calculate: https://ninjatrader.com/support/help.../calculate.htm

    To understand why the script is behaving as it is, such as placing orders or not placing orders when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

    In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. This will allow you to see how the conditions to place the order are evaluating. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

    Note that sell stop limit orders must be placed below the current bid price (below the market). If you place the order above the market price, the error you mentioned will appear.

    ​When the order is submitted, is the stop price parameter less than the GetCurrentBid()?

    Prints will need to be added to the strategy to determine why the stop order is returning this error or being placed unexpectedly. One line above where the stop order is placed, you could print the GetCurrentBid() value, print the price being submitted to the order method, print the CurrentBar, and print the Time[0].

    GetCurrentBid(): https://ninjatrader.com/support/help...currentbid.htm

    Below is a link to a forum post that demonstrates using prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      thanks brandon I apprecitte your time, I have a question to how place the order limit EnterShortStopLimit(int quantity, double limitPrice, double stopPrice, string signalName)
      ​im using this format, but Im little confused with stopprice and limit price mean, can you explain me how to use this parameters thanks ,

      Comment


        #4
        Hello FernandoParra,

        Thanks for your note.

        EnterShortStopLimit() takes a stop price argument and a limit price argument.

        The stop price argument refers to the stop price of the order and the limit price refers to the limit price of the order. Note that the limit price cannot be greater than the stop price for a sell stop limit order.

        The stop-limit order waits until the specified stop price has been reached. Unlike the stop order though, the stop-limit order becomes a limit order instead of a market order when the stop price is reached.

        Order Types: https://ninjatrader.com/support/help...rder_types.htm
        EnterShortStopLimit(): https://ninjatrader.com/support/help...tstoplimit.htm
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        21 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        120 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        63 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        45 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X