Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to determine when ProfitTarget is triggered?

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

    How to determine when ProfitTarget is triggered?

    Hello,

    How can I determine when my SetProfitTarget is triggered to execute further logic?

    Thank you!

    #2
    Hello Dragon989,

    Thank you for your note.

    You could see the following example which demonstrates how to determine whether your stop/target were hit.


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you! How do you differentiate between different ProfitTargets? I noticed the order name was "Profit Target". How would I now which one was long or short or which of my Profit Targets was triggered as they have different entry signals.

      Comment


        #4
        Hello Dragon989,

        In the case of multiple Profit Targets working you would want to filter by FromEntrySingal as well.

        For example,

        protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
        {
        if (order.Name == "Profit target" && order.FromEntrySignal =="LongA")
        {
        //Do Something.
        }

        if (order.Name == "Profit target" && order.FromEntrySignal =="LongB")
        {
        //Do Something.
        ​​​​​​​}
        }

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        72 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X