Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Identifying entry signal of current position

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

    Identifying entry signal of current position

    My strategy uses multiple entry signals (e.g., Signal1, Signal2, etc.). I'd like to have different stoploss modifications for these entries (e.g., Signal1 stoploss modification, etc.), so when I have an existing position, I need to be able to determine which entry signal generated that position in order to apply the correct stoploss adjustment.

    Is there an easy way to determine this within OnBarUpdate (i.e., without having to get into OnOrderUpdate)?

    #2
    Hello dolomite,

    Thank you for your post.

    You would likely want to associate the Position.AvgPrice with the order that you submitted, that is if the two entries used different price levels. However, this is not exact - what if both orders fill at the same price? Plus if both orders fill and not at the same price level we would pull the average price of the two fills.

    What are you trying to adjust? A SetStopLoss() or an Exit method?

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      What are you trying to adjust? A SetStopLoss() or an Exit method?
      SetStopLoss

      So I'm something like . .

      If [have an existing position from Signal1]
      SetStopLoss("Signal1", CalculationMode.Price, some calculated price, false)

      If [have an existing position from Signal2]
      SetStopLoss("Signal2", CalculationMode.Price, some other calculated price, false)
      Last edited by dolomite; 02-19-2015, 12:59 PM.

      Comment


        #4
        Hello dolomite,

        Thank you for your response.

        Track the execution of the entry in OnExecution(), store the values of the fill price and/or track that a position is opened by a signalName. Then check these value sin OnBarUpdate().

        For information on OnExecution() please visit the following link: http://www.ninjatrader.com/support/h...nexecution.htm

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello dolomite,

          Thank you for your response.

          Track the execution of the entry in OnExecution(), store the values of the fill price and/or track that a position is opened by a signalName. Then check these value sin OnBarUpdate().

          For information on OnExecution() please visit the following link: http://www.ninjatrader.com/support/h...nexecution.htm
          I was hoping to keep this simple and stay in OnBarUpdate, but if I must mess around with OnExecution, I guess I will.

          What happens if I don't check to see which signal a position was created from, and simply execute the following:
          SetStopLoss("Signal1", CalculationMode.Price, some calculated price, false)
          SetStopLoss("Signal2", CalculationMode.Price, some other calculated price, false)

          If there is no position created by Signal1 entry, will this throw an error?

          Comment


            #6
            Hello dolomite,

            Thank you for your response.

            It would generate a message in the log but should not affect the functionality of the other SetStopLoss().

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            590 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            342 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            555 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X