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 ageeholdings, Today, 07:43 AM
        0 responses
        6 views
        0 likes
        Last Post ageeholdings  
        Started by pibrew, Today, 06:37 AM
        0 responses
        4 views
        0 likes
        Last Post pibrew
        by pibrew
         
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        12 views
        0 likes
        Last Post burtoninlondon  
        Working...
        X