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

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.
    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rtwave, 04-12-2024, 09:30 AM
        4 responses
        29 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by yertle, Yesterday, 08:38 AM
        7 responses
        28 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        21 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by funk10101, Today, 12:02 AM
        0 responses
        6 views
        0 likes
        Last Post funk10101  
        Started by gravdigaz6, Yesterday, 11:40 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X