Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExcecution() BIP question

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

    OnExcecution() BIP question

    Hi,

    I'm developing a multi-Instrument strategy that have a global percentage StopLoss set for all the instruments.
    I want to be able to know in the OnExcecution() which BIP called the StopLoss.
    How can I know in OnExcecution() which BIP called the stoploss?

    Thanks in advance!

    #2
    You could include this in the signal name you attach to your StopLoss exit order, so you could with the .FromEntrySignal IOrder property or .Name of the IExecution.

    Comment


      #3
      But I set a global StopLoss in the Initialize():
      Code:
      Initialize(){
      ....
      SetStopLoss(CalculationMode.Percent, 0.01);
      }

      Comment


        #4
        The Set() stops would be always tied to the primary series of the instrument.

        Comment


          #5
          But in my strategy I see that it also execute StopLoss to the other series...

          Comment


            #6
            Sorry misread and thought you were bulding a MultiSeries strategy, but you're correct for a Multi Instrument one you would for sure see stop loss execute for other series than the primary as well - if you're not working with the Exit methods that would allow for direct IOrder access, then you can use the ideas of this reference sample below to store IOrder returns for the Set()'s as well that would allow then to access for example the Entry Signal name in OnExecution, which then in turn you could tie to the processed series for identification purposes.

            Comment


              #7
              Thanks Bertrand.
              This is in the direction of what I need, but how do I check from IOrder which BIP was calling the StopLoss?

              Comment


                #8
                You're welcome, you should be able to do this by assigning the FromEntrySignal as needed to which the SetStop is tagged. You can then check this property of the IOrder / IExecution.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by CarlTrading, 03-31-2026, 09:41 PM
                1 response
                65 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 04-01-2026, 02:41 AM
                0 responses
                35 views
                0 likes
                Last Post CarlTrading  
                Started by CaptainJack, 03-31-2026, 11:44 PM
                0 responses
                59 views
                1 like
                Last Post CaptainJack  
                Started by CarlTrading, 03-30-2026, 11:51 AM
                0 responses
                62 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 03-30-2026, 11:48 AM
                0 responses
                51 views
                0 likes
                Last Post CarlTrading  
                Working...
                X