• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecutionUpdate provides null FromEntrySignal on Stops

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

    OnExecutionUpdate provides null FromEntrySignal on Stops

    When a stop is hit in a strategy, the order name will be "Close position" which is fine but the execution.Order.FromEntrySignal will be null even when we only use Entry Signals for every order. I feel this should be set to the orginal entry signal so that we can capture the applicable order record.

    execution.Order.Name.ToLower() == "close position" always produces null execution.Order.FromEntrySignal

    Either that - or give us some way to relate the ticket back to the original entry signal. I have looked at the object in detail - I see no reference to it.

    #2
    I am also seeing the same issue with "profit target", "exit on close", and "stop loss". It would be extremely helpful for NT to provide the previous associated signal name.

    Comment


      #3
      Hello MarketAlly,

      Thank you for your note.

      In each of the methods you use to exit do you list the string fromEntrySignal?

      For example:
      Code:
      ExitLongStopMarket(Position.AveragePrice - 8 * TickSize, "exit", "enter");
      Patrick H.NinjaTrader Customer Service

      Comment


        #4
        Yes - the first item is the fromEntrySignal and it is always passed.

        SetProfitTarget(newMarker.Id.ToString(), CalculationMode.Price, execution.Order.AverageFillPrice + (double)newMarker.TimeFrame.scalpAmount, thePosition.scalpMIT);

        SetStopLoss(newMarker.Id.ToString(), CalculationMode.Price, (double)newMarker.stopPrice, thePosition.simStops);

        I never call the Exit routine - when Close Position is called or another of the listed events, it is done by NT.
        Last edited by MarketAlly; 04-11-2016, 09:51 AM.

        Comment


          #5
          Hello MarketAlly,

          Thank you for your response.

          Can you provide the full code used to test this?
          Patrick H.NinjaTrader Customer Service

          Comment


            #6
            I cannot give you my code - it is not a simply strategy and uses DLLs/SQL Server to encapsulate the logic but the OnExecute and OnBarUpdate have basic calls using the following commands with fromEntrySignal for all operations. I only use these 4 with fromEntrySignal since my system only creates orders with relating marker ids.

            EnterLong
            EnterShort
            SetProfitTarget
            SetStopLoss

            If you create a strategy and have the NT issue a Close Position for the execution.Order.Name - you will see the fromEntrySignal is empty.

            Comment


              #7
              Hello MarketAlly,

              Is this a reversal strategy? The use of 'Close position' is only seen in the case of a close position to reverse the current position. I am surprised the Stop Loss and Profit Target are returning the fromEntrySignal as null. Can you provide the code used to verify this on your end and the output?
              Patrick H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Moody1337, Today, 09:25 AM
              0 responses
              3 views
              0 likes
              Last Post Moody1337  
              Started by franco12364, Today, 08:59 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Kate  
              Started by kweiss, Yesterday, 08:35 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by franco12364, Today, 08:36 AM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_Jim  
              Started by Aporshnev, Today, 02:36 AM
              2 responses
              7 views
              0 likes
              Last Post Aporshnev  
              Working...
              X