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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        41 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X