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

Limit TP and Stop from within a Strategy

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

    Limit TP and Stop from within a Strategy

    I have a strategy that successfully enters a limit order. I want the stop and the take profit to also be limit orders.
    I am using the sample code from ExampleLimitEntryandStopProfit. For this example, let's say it is short.
    I enter using EnterShortStopLimit...that works fine.
    I can put the take profit entry on using ExitShortLimit and giving it a target...that works fine.
    When I put the stop on using ExitShortStopLimit I get an error message saying that "Limit price cannot be smaller than stop price" and it gives me the affected order.

    If I manually place an order on the screen I will click sell the Ask.
    Then right click and place a Buy Stop Limit order above the entry.
    Then I right click again and place a Buy Limit order for the take profit.
    I am trying to do the same thing in the program.

    A secondary question is if there is a good OCO example so if a stop or target is hit the other order is removed.
    Thanks
    Last edited by cpabiz20k; 12-20-2021, 08:18 PM. Reason: I am moving this to the Strategy Development Group...

    #2
    Hello cpabiz20k,

    Thank you for your note.

    Sell Stop Limits with Limit price lower than the Stop price are Simulated Stop Limit orders. Simulated stop limit orders cannot be created with NinjaScript.

    Please let us know if we may be of further assistance to you.
    Last edited by NinjaTrader_Kate; 12-24-2021, 07:49 AM.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Can I flag that as an improvement that needs to be made please.
      It would be nice to be able to code an order that is 'hidden' from the exchange.

      Comment


        #4
        Hello Mindset,

        Thank you for your suggestion.

        I have added a vote for you to a current feature request to support simulated stop limit orders. This request is being tracked under the number SFT-126.

        As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

        Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rtwave, 04-12-2024, 09:30 AM
        4 responses
        31 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by yertle, Yesterday, 08:38 AM
        7 responses
        29 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        22 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