Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitShortStopLimit(

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

    ExitShortStopLimit(

    Hi all,

    I ran the code below to exit my positions. It worked quite well. Unfortunately however the Strategy execution also stopped. Is this to be expected?

    ExitShortStopLimit(tickPrice +1, tickPrice +1); //Just get out!!

    I noticed that the log and trace files ended when the positions were closed. I really expected it to run OnExecution or at least OnMarketData.

    Please advise

    #2
    Cocopod,

    Is the strategy still running in the Strategies Tab?

    Do you see the execution in the Log Tab of the Control Center?

    Do you have prints or other orders in the OnExecution()?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi...

      the strategy is still selected in the Strategies tab and under the log tab I can see 2 entries. One for the position where I went long and the other "Execution" where the Position was closed, presumably by
      ExitShortStopLimit.

      In my OnExecution section I have 3 if statements

      if (longOrder != null && longOrder == execution.Order && execution.Order.OrderState == OrderState.Filled)

      else if (shortOrder != null && shortOrder == execution.Order && execution.Order.OrderState == OrderState.Filled)

      else if (stopOrder == execution.Order && execution.Order.OrderState == OrderState.Filled)

      There are a number of Print statements however none are executed. In the log the last statement refers to the cancelling of the Stop

      20/11/2014 11:39:18|1|16|Execution='ce7c68b664ad47328e32cc775 aa87e07' Instrument='GC 12-14' Account='Replay101' Exchange=Default Price=1154.8 Quantity=1 Market position=Short Operation=Insert Order='e7be6d2e02a54084bd9bfbfb6f4156fb' Time='07/11/2014 13:30:01'
      20/11/2014 11:39:18|1|64|Instrument='GC 12-14' Account='Replay101' Avg price=1154.8 Quantity=0 Market position=Long Operation=Remove Currency=Unknown

      Comment


        #4
        Cocopod,

        Please send me your log and trace files to platform support by going to Help -> Mail to Platform Support

        Put ATTN Cal in the Subject and reference this thread in the Body
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X