Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterShortStopLimit numbers off and order cancelling

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

    EnterShortStopLimit numbers off and order cancelling

    I finished my logic on EnterShortStopLimit and I am perplexed why my numbers are not entering correctly. On the output box vs on the screen are different.

    I printed my order before submitting it.
    if (MarketPosition.Flat == Position.MarketPosition && entryOrder == null && BarsInProgress == 0)
    {
    Print("EnterShortStopLimit " + nNumberOfContracts +" " + DEV1[0] + " " + (DEV1[0] + nStopLoss * TickSize) + " MyEntry");
    EnterShortStopLimit(nNumberOfContracts, DEV1[0], DEV1[0] + nStopLoss * TickSize, "MyEntry");
    }
    My limit order is 8827 on the output box is
    but the order on the screen is 8832

    The second issue :
    Minute 1 the order is placed.
    Minute 2 order cancels out
    Minute 3 the order is placed again.

    This is the continuous cycle.

    .

    #2
    Hi ballboy11, thanks for your question.

    I tested an order and got correct results, so there is some bug in whatever is calculating DEV1, consider printing all of the values that lead up to this order being placed.



    For the second question, by default, an order is canceled on every bar close and you need to resubmit the order on every bar to keep it alive. If you don't want to do this, you can use the method override that takes the isLiveUntilCancelled boolean:

    EnterShortStopLimit(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double limitPrice, double stopPrice, string signalName);

    Make sure you understand all concepts for advanced order entry. We have this documented here:


    Please let me know if I can assist any further.

    Comment


      #3
      I think I might of found my issue. Thank you for the second question being answered. I need to verify the 2 prices posted.
      double limitPrice,
      double stopPrice



      I noticed on my data the 8832 price is my order entry price that is filled.
      May you explain to me the difference between the LimitPrice and the Stop Price in this funtion.

      I understand what a limit order is and a stop order but this function StopLimit is confusing me.

      Comment


        #4
        Hi ballboy11, thanks for your reply.

        Pulling a definition from the internet:

        The stop price is the price that activates the limit order and is based on the last trade price. The limit price is the price constraint required to execute the order, once triggered.

        If you would like more information about all order types, please send an email to brokeragesupport at ninjatrader.com and request this information.

        Please let me know if I can assist any further.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X