Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

IOrder Order.name and Sample Monitor StopProfit

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

    IOrder Order.name and Sample Monitor StopProfit

    Hi,
    I have a question about the Sample Monitor StopProfit supplied with Ninja. In OnOrderUpdate it checks for orderName == "Stop Loss" and order.Name == " Profit target" yet neither of these names are defined as signal names for the SetStopLoss or SetProfitTarget orders. Are these default signal names? and if yes where are these specified in the documentation so I can use them with other orders as well. I have been unable to locate any mention of default names.

    Thanks
    Jerry

    #2
    Hi JerryWar,

    The SetStopLoss, SetTrailStop, and SetProfitTarget do have signal names that cannot be changed.

    These are not in the help guide. But you can find the signal name used for any special orders by printing the signal name in OnOrderUpdate(). Print(order.Name);

    SetStopLoss will have a signal name of 'Stop loss'.
    SetTrailStop will have a signal name of 'Trail stop'.
    SetProfitTarget will have a signal name of 'Profit target'.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hi JerryWar,

      The SetStopLoss, SetTrailStop, and SetProfitTarget do have signal names that cannot be changed.

      These are not in the help guide. But you can find the signal name used for any special orders by printing the signal name in OnOrderUpdate(). Print(order.Name);

      SetStopLoss will have a signal name of 'Stop loss'.
      SetTrailStop will have a signal name of 'Trail stop'.
      SetProfitTarget will have a signal name of 'Profit target'.
      ChelseaB,
      Whoah, you just threw me. I thought ex. SetStopLoss() parameter "fromEntrySignal" was a signal name used to tie a Stop Loss and Profit Target together with an Entry Signal to OCO. Is this different from the IOrder Order.Name ? What am I missing ?
      If it is an EntrySignal name only, used to tie the orders together. How are Multiple orders with different entry signal names segregated by IOrder if the actual SetStopLoss order names are all the same.

      Thanks
      Jerry
      Last edited by JerryWar; 04-03-2014, 11:17 AM.

      Comment


        #4
        Hi JerryWar,

        The signal name is different from the fromEntrySignal.

        The fromEntrySignal is used to attach an exit order to a particular entry order using the entry order's signal name.

        In other words, the SetStopLoss can use a fromEntrySignal to attach to a particular entry's signal name. The SetStopLoss also has its own signal name which is 'Stop loss'.

        The IOrder order.Name is the signal name.

        The signal name of SetStopLoss is not used to tie the order to the entry. The fromSignalName is used for that.

        Because you cannot attach an exit order to another exit order, it doesn't matter that all of the SetStopLosses use the same signal name as you cannot attach an order to a SetStopLoss order.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          ChelseaB,

          Right before I received your response as I reread the IOrder Methods and Properties I realized part of my misunderstanding. Let me re-phrase a question to clear up where my thinking was going.

          If I want to check the status of a Stop loss I would need to use IOrder.Name =="Stop Loss"

          If I want to check the status of a Working Limit Order I would need to use IOrder.FromEntrySignal =="What ever Name I gave it" or can I Still use IOrder.Name

          I am still confused on this point.

          thanks
          Jerry
          Last edited by JerryWar; 04-03-2014, 11:41 AM.

          Comment


            #6
            Hello JerryWar,

            That is incorrect.

            For all orders if you want to find them by the signalName in OnOrderUpdate you will use the signalName.

            So for the stop loss:
            order.Name == "Stop Loss"

            For a working order limit order
            order.Name == "myLongEntry"

            If you want to find out what order a stop loss is attached to, use the fromSignalName:
            if (order.Name == "Stop loss")
            {
            Print(order.fromEntrySignal);
            }


            The SetStopLoss IOrder object is the same as an ExitLongStop. Its just created for you and managed by the NinjaTrader NinjaScript engine. It still has a signalName (Stop loss) but you do not have the option to change this.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              ChelseaB,
              Now it is clear to me.

              Thanks
              Jerry

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by JoMoon2024, Today, 06:56 AM
              0 responses
              6 views
              0 likes
              Last Post JoMoon2024  
              Started by Haiasi, 04-25-2024, 06:53 PM
              2 responses
              18 views
              0 likes
              Last Post Massinisa  
              Started by Creamers, Today, 05:32 AM
              0 responses
              6 views
              0 likes
              Last Post Creamers  
              Started by Segwin, 05-07-2018, 02:15 PM
              12 responses
              1,786 views
              0 likes
              Last Post Leafcutter  
              Started by poplagelu, Today, 05:00 AM
              0 responses
              3 views
              0 likes
              Last Post poplagelu  
              Working...
              X