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

Which order/execution?

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

    Which order/execution?

    Hello,

    I do not see in the executions tab nor in log tab which exit (of more than 1 positions) has been triggered(?)

    Thank you!
    Tony
    Attached Files

    #2
    Hi Tony, thanks for your question.

    The Signal Name you give the orders will be the best way of tracking the orders. The Signal Name is the user-configurable order ID that can be given to the order object.

    Please let me know if this does not resolve your inquiry.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      sure, therefore I have {ExitLong("dtjRL1a"); exitlong1=GetCurrentAsk();} or {ExitLong("djRL1a"); exitlong1=GetCurrentAsk();}
      but with the exitlong of "dtjRL1a" I have only the Sell in executions-tabdtRL1a and djRL1a is not visible, not in orderstab nor in executionstab (screenshot of both here, there is only "sell" but not the signalname)

      ??

      In this concern I have another question please: how can I assign the exitprice to a double, for now I do with exitlong1=GetCurrentAsk() but this is not accurate. I tried to get it from the SampleOnOrderUpdate but I cant find a solution from there.

      Thank you!
      Tony
      Attached Files
      Last edited by tonynt; 06-21-2020, 03:16 PM. Reason: add info

      Comment


        #4
        Hello tonynt,

        Thanks for your reply.

        The help guide advises that you can use the entry signal name as the link that ties the entry to the exit method, however, you can also specify a separate name for the exit. Here is the optional overload of the method for that: ExitLong(int quantity, string signalName, string fromEntrySignal): https://ninjatrader.com/support/help.../?exitlong.htm

        In your example, you only specified the entry signal name: ExitLong("dtjRL1a").

        For example, you could use: ExitLong(1, "my Exit name here","dtjRL1a");. in the panels you would see "my Exit name here" instead of "sell".

        To answer your next question of "how can I assign the exitprice to a double, for now I do with exitlong1=GetCurrentAsk() but this is not accurate. I tried to get it from the SampleOnOrderUpdate but I cant find a solution from there." In SampleOnOrderUpdate, you can pull the stop order price in the OnExecutionUpdate() method.

        For example:

        if (stopOrder == execution.Order)
        Print ("StopPrice filled at "+execution.Order.AverageFillPrice);
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hello PaulH,

          thank you for your reply. This will help me.

          But today I´m experiencing a new strange behavior: when my conditions are true then the script should do the exit and assign the ask (or bid) to the double. It does assign the ask to "exitlong1" but it doesnt execute the exit. What might be the reason for this please? In the attached screenshot you can see the code. I know that the askprice was assigned to "exitlong1" because I plot it in the chart for debugging. But no exit.

          Same now with a short. In the screenshot you can see in the red circle that there was the value assigned to "exitshort" but no exit (its simply a type in my drawtextfixed that there appears exitshort and not exitshort1.

          ??

          I have an idea now after I replied: the position is from "ntryOrderSr1a=EnterShortLimit(4,true,1,GetCurrent Bid(), "dtjRS1a");"
          Is it possible that the exit is not executed because I have to refer to the instrument/dataseries"4". In replay with ES all worked fine on the weekend, today when I changed [4] from ES to MES there is no exit (while the doubles exitshort1 and exitlong1 get the value from ES)

          ??

          Thank you!
          Tony
          Attached Files
          Last edited by tonynt; 06-22-2020, 12:35 PM. Reason: idea

          Comment


            #6
            Hello tonynt,

            Thanks for your reply.

            Please check your log tab of the control center for any relevant error messages.

            If no error messages then you will need to debug your strategy to find out why it is not executing as you expect.

            As a small team, we cannot provide debugging services.



            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hello PaulH,

              you dont need to do for me debugging.

              It did not work because one has to refer to that dataseries in exitlong/exitshort.

              Finally, what I do not understand is what you mean above with if(stoporder=executionorder).
              What I understand is that I can catch it in onexecution but not in onorderupdate. Correct?

              So when I have now {ExitLong(4,1,"xdtjRL1a","dtjRL1a");} how do I add this please in onexecution to get the exitprice in double exitlong1?
              if(??=execution.order)
              exitlong1=execution.Order.AverageFillPrice;

              ??

              Thank you!
              Tony


              Last edited by tonynt; 06-22-2020, 12:59 PM.

              Comment


                #8
                Hello tonynt,

                Thanks for your reply.

                To understand my example please refer back to SampleOnOrderUpdate() where stopOrder was an order object assigned as the stop loss order.

                You can also check the order by name if you wish.
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by trilliantrader, 04-18-2024, 08:16 AM
                7 responses
                27 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by samish18, 04-17-2024, 08:57 AM
                17 responses
                64 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by rocketman7, Today, 02:12 AM
                2 responses
                18 views
                0 likes
                Last Post rocketman7  
                Started by briansaul, Today, 05:31 AM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by PaulMohn, Today, 03:49 AM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X