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

unable to script strategy with entries limit and stop OCO

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

    unable to script strategy with entries limit and stop OCO

    I can't figure out how to do this - I want to put an OCO bracket into force with a limit on one side of the market and a stop on the other - so both buy or both sell but OCO so that only one is executed.

    I get this from traceOrders:

    04/08/2010 09:02:00 Entered internal PlaceOrder() method at 04/08/2010 09:02:00: Action=SellShort OrderType=Limit Quantity=0.1M LimitPrice=1.3200'5 StopPrice=0 SignalName='Enter S' FromEntrySignal=''
    04/08/2010 09:02:00 Entered internal PlaceOrder() method at 04/08/2010 09:02:00: Action=SellShort OrderType=Stop Quantity=0.1M LimitPrice=0 StopPrice=1.3195'5 SignalName='Enter S' FromEntrySignal=''
    04/08/2010 09:02:00 Ignored PlaceOrder() method at 04/08/2010 09:02:00: Action=SellShort OrderType=Stop Quantity=0.1M LimitPrice=0 StopPrice=1.3195'5 SignalName='Enter S' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'

    #2
    Hello Adamus,

    The trace you posted indicates:
    Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'

    You could name each uniquely and then set entry handling to Unique Entries. It will then allow both orders to be placed.

    If one or the other is filled then you'd have to issue cancel commands on the other. This reference sample helps with CancelOrder()
    When using NinjaTrader's Enter() and Exit() methods, the default behavior is to automatically expire them at the end of a bar unless they are resubmitted to keep them alive. Sometimes you may want more flexibility in this behavior and wish to submit orders as live-until-cancelled. When orders are submitted as live-until



    You may also want to move to an unmanaged approach to order submission - offered only in version 7. You can then tie the orders together with the same OCO id and they will not be governed by entriesPerDirection and entryHandling properties.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan, thanks for the explanation. I was hoping it would be simpler than that - after working with OCO exit orders I guess my expectations were just wrong.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by algospoke, Today, 06:40 PM
      0 responses
      9 views
      0 likes
      Last Post algospoke  
      Started by maybeimnotrader, Today, 05:46 PM
      0 responses
      7 views
      0 likes
      Last Post maybeimnotrader  
      Started by quantismo, Today, 05:13 PM
      0 responses
      7 views
      0 likes
      Last Post quantismo  
      Started by AttiM, 02-14-2024, 05:20 PM
      8 responses
      168 views
      0 likes
      Last Post jeronymite  
      Started by cre8able, Today, 04:22 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X