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

Stopmarket order not being created

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

    Stopmarket order not being created

    I am trying to create TP and Stopmarket order for my order. The TP order is being placed but the stopmarket order is not. Could someone help me with this?

    Code:
    EnterLongStopLimit(NumberOfContracts, limitPrice, stopPrice, "LongOrder");
    SetProfitTarget("LongOrder", CalculationMode.Price, tpPrice);
    ExitLongStopMarket(_indicatorCandleLowForLong, "LongOrder");

    #2
    I changed it to use SetStopLoss and it is working now. Not sure how the two are handled differently, but can close this topic thank you

    Comment


      #3
      Hello sofortune,

      The reason for that is because you were submitting a ExitLongStopMarket instead of calling one of the Set methods, ExitLongStopMarket expects that you are already in a position which was entered using the entry name specified, when submitting the entry it is not yet in a position so that exit method is ignored. The set methods just set an internal note that targets should submit once the entry fills, those orders are not submitted at the same time that you submit the entry, they wait for the fill before submitting.

      JesseNinjaTrader Customer Service

      Comment


        #4
        Thanks that makes sense now

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by psangram, Today, 03:14 AM
        0 responses
        1 view
        0 likes
        Last Post psangram  
        Started by giogio1, Today, 02:56 AM
        0 responses
        2 views
        0 likes
        Last Post giogio1
        by giogio1
         
        Started by Skifree, Today, 02:42 AM
        0 responses
        4 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by cathypriester, Today, 01:50 AM
        0 responses
        6 views
        0 likes
        Last Post cathypriester  
        Started by DJ888, 07-11-2024, 09:28 PM
        3 responses
        28 views
        0 likes
        Last Post CassieQuinn  
        Working...
        X