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

Submitting limit + stop loss order?

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

    Submitting limit + stop loss order?

    Hello,

    I'm starting to carve out my strategy. I have the logic working as an Indicator.

    I am having trouble submitting my orders, I would like to submit:
    1. A limit buy order based on current price (I don't want the order floating as a market order)
    2. Profit target of 4 ticks
    3. Stop loss of 8 ticks.

    This example shows the entry price and stop proce, but not target price.

    EnterLongStopLimit(High[0] + 2 * TickSize, High[0], "SMA Cross Entry");

    How can I do this?

    Many Thanks, Caesar.

    #2
    Hello Caesar,

    Thank you for your note.

    The example for EnterLongStopLimit() that you are looking at refers to a stopPrice as where to place the "stop" part of the Stop Limit order. This is not the same as a stop loss, like the stop loss of 8 ticks you mentioned. If you simply want a limit order for your entry, you could use the EnterLongLimit() or EnterShortLimit() order methods:



    When using the managed approach for your NinjaScript strategy, you could submit protective Stop Loss and Profit Target orders using the SetStopLoss() and SetProfitTarget() methods. A reference sample of how the SetStopLoss() and SetProfitTarget() methods could be used is located here:


    In that example, you could change the StopLossTicks to 8 and ProfitTargetTicks to 4. The sample also demonstrates how to set your Stop Loss to a breakeven price after 50 ticks of profit is met; this wouldn't occur if you had the ProfitTargetTicks set to 4.

    Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Many Thanks Emily!

      Comment


        #4
        Hello Emily,

        Also when submitting EnterLongLimit ... is the price used Close[0] or Close[0] + or - TickSize (this is a Renko bar)?

        Many Thanks, Caesar.

        Comment


          #5
          Hello Caesar,

          Thank you for your reply.

          The price used for EnterLongLimit() will depend on where you would like the limit order to be placed. Close[0] would place it at the Close price of the current bar. If you add or subtract ticks from the Close[0] then the order will be placed at a price that many ticks above or below the Close price for the current bar. If you are unsure which order type you would like to use, I suggest reviewing the blog post here for an explanation of how LImit, Stop-Market, and Stop-Limit orders function to gain a better understanding of which order type and what price you would want to utilize in your strategy:
          NinjaTrader is a leading futures broker & trading platform provider with deep discount commissions as low as $.09 per Micro contract. Start your FREE demo powered by live data.


          Please let us know if we may be of further assistance.
          Emily C.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by frankthearm, Today, 09:08 AM
          8 responses
          32 views
          0 likes
          Last Post frankthearm  
          Started by NRITV, Today, 01:15 PM
          2 responses
          9 views
          0 likes
          Last Post NRITV
          by NRITV
           
          Started by maybeimnotrader, Yesterday, 05:46 PM
          5 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by quantismo, Yesterday, 05:13 PM
          2 responses
          20 views
          0 likes
          Last Post quantismo  
          Started by adeelshahzad, Today, 03:54 AM
          5 responses
          33 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X