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

Order Handling

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

    Order Handling

    Hello,

    in the "SampleOnOrderUpdate" there is the stoploss with ExitLongStopMarket and the Target with ExitLongLimit (in OnExecutionUpdate)

    Do they work same as "normal" Setstoploss and Setprofittarget? Do they work also OCO (if stoploss hit then target cancelled and if target hit then stoploss cancelled)?

    Thank you!
    Tony

    #2
    Hello Tony,

    Thanks for your question.

    Exit methods will use logic built in to NinjaTrader to cancel orders that are tied via Entry Signals. Native OCO is not used here like they are with the Set methods. OCO can be implemented freely in Unmanaged strategies if native OCO is needed.

    We look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply. OK, so in the "SampleOnOrderUpdate" the "OCO functionality between stop and target" (so that stop is cancelled when target is hit and vv) is then in line 139 and 140 with stoporder=null and targetorder=null? It is not necessary to "Cancel stopOrder...", its enough to set it "null" without "cancel..."

      And because it is very important - and not clear to many people from what I know in our traderoom - I want to ask in this concern: stop and target are on the exchange but when internetconnection is broken then from the code in "SampelOnOrderUpdate" the stop is not cancelled when target is hit and vv the target is not cancelled when stop is hit because the OCO-functionality is on the pc (has to be cancelled with re-established connection or by phone, or its too late because one is in a trade (naked) already). Yes? No?

      BUT when working with SetProftTarget and SetStopLoss and NinjaTrader Continuum then the stop and the target is also at the exchange but in this case even when internetconnection is interrupted from traders pc then OCO will work and stop is cancelled when target is hit and target is cancelled when stop is hit. Yes? No?

      Thank you!
      Tony

      Comment


        #4
        Hello Tony,

        Yes, and Yes.

        Set methods use native OCO and Unmanged orders can use native OCO. Exit methods use local logic to cancel the other order.

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,283 views
        0 likes
        Last Post Leafcutter  
        Working...
        X