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

Direction dependent Limit Order

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

    Direction dependent Limit Order

    Hello traders,

    I have a question about filling orders. In some cases when a position is taken the market turns on you before hitting the first (small) target and never comes back (false move). You end up losing all your positions against your StopLoss price. Creating a very tight StopLoss protects you against big losses, but will often stop you out too early in a potential good trade.

    Question: Would it be possible to make a Limit order that looks at the direction it is appoached?

    Example for long order:
    1. Go long conditions are met
    2. Submit Limit order few Ticks below the market
    3. Market goes down below the Limit price
    4. Limit order does not get filled yet!

    Scenario 1:
    5. Market turns up before hitting the StopLoss
    6. Go long conditions are still met
    7. Market hits Limit price and order gets filled
    8. Market keeps on rising making a good trade!

    Scenario 2:
    5. Market does not turn up
    6. Go long conditions are no longer met
    7. Limit order will be cancelled
    8. It was a false move but no money lost!

    To my knowledge there is no standard order type with that behavior. Are there any suggestions for some code that simulates this behavior? It should work with 'calculate on bar close' too!

    Thanks,

    Ducman

    #2
    Hello Ducman_nl,

    Welcome to the NinjaTrader forums!

    Unfortunately I'm not familar with an order type that does exactly this or how you might simulate with code. If you can identify the conditions objectively, then you should be able to submit a market order at the appropriate time.

    You may consider looking into stoplimit orders and simulated stop orders. Stoplimit orders can be used to specify a limit price that is better than the stop price. These orders are not supported by exchanges but can be simulated by NinjaTrader. Simulated stop orders allow you to specify a real time bid /ask volume threshold that must be satisfied before the order is submitted. See the link below for more information on simulated stops.

    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply,

      I briefly looked into simulated orders but I see quite some risks mentioned that are attached to this when in a quick moving market or in case the internet connection is lost. Missing an entry is not so bad but when there is the risk of being in the market without a stoploss order submitted is not so great. I will look into simulated orders more deeply to make a good judgement.

      Ducman

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kaywai, Today, 06:26 AM
      1 response
      6 views
      0 likes
      Last Post kaywai
      by kaywai
       
      Started by ct, 05-07-2023, 12:31 PM
      6 responses
      205 views
      0 likes
      Last Post wisconsinpat  
      Started by kevinenergy, 02-17-2023, 12:42 PM
      118 responses
      2,780 views
      1 like
      Last Post kevinenergy  
      Started by briansaul, Today, 05:31 AM
      0 responses
      10 views
      0 likes
      Last Post briansaul  
      Started by traderqz, Yesterday, 12:06 AM
      11 responses
      28 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X