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", [B]"enter"[/B]);

      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, 10:51 AM.

        Comment


          #5
          Hello MarketAlly,

          Thank you for your response.

          Can you provide the full code used to test this?

          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?

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,266 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X