• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders and BarsInProgress

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

    Orders and BarsInProgress

    Several Questions to anyone who feels Qualified.

    Assume I place orders of the form

    EnterLongStop(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double stopPrice, string signalName)

    at a point in my code where barsInProgress= 3 in OnBarUpdate() and I Submit the EnterLongStop() with barsInProgressIndex=0

    1) Can I do this? i.e submit and order which is tied to barsInProgress=0 while BarsinProgress =3 ?

    2) Will Ninja wait until barsInProgess =0 before Submitting the order

    3) Will all Ninja Manipulations of the order I may need to make have to take place when barsInProgressIndex = 0 ?

    Thanks
    Jerry

    #2
    Hello Jerry,

    Thank you for your post.

    Yes, you will be able to submit an order that is not tied to the BarsInProgress.

    No, as soon as the line of code is reached and valid it will submit the order to the BarsInProgress it is assigned

    No, you can manipulate the order at any point in the code that you see fit.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Hello Jerry,

      Thank you for your post.

      Yes, you will be able to submit an order that is not tied to the BarsInProgress.

      No, as soon as the line of code is reached and valid it will submit the order to the BarsInProgress it is assigned

      No, you can manipulate the order at any point in the code that you see fit.

      Let me know if I can be of further assistance.

      Cal,
      a quick follow up and then a comment.

      Based on your responses. I am not sure I understand why orders are tied to BarsinProgress, unless it is just used to distinguish between different symbols in a multi-Symbol environment.

      This was one of the best most concise answers I think I have ever received.
      Thanks

      Jerry

      Comment


        #4
        Originally posted by JerryWar View Post
        Cal,
        a quick follow up and then a comment.

        Based on your responses. I am not sure I understand why orders are tied to BarsinProgress, unless it is just used to distinguish between different symbols in a multi-Symbol environment.

        This was one of the best most concise answers I think I have ever received.
        Thanks

        Jerry
        Yes that is one portion of the picture.

        If you have multiple Bars objects of the same instrument and are using Set() methods in your strategy, you should only submit orders for this instrument to the first Bars context of that instrument.This ensures that your order logic will be processed correctly and any amendments done correctly.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Cal,

          "If you have multiple Bars objects of the same instrument" Which I do,

          "and are using Set() methods in your strategy, " Which I am, SetProfitTarget() and SetStopLoss() each which change with the trade setup.

          "you should only submit orders for this instrument to the first Bars context of that instrument." -

          By "First Bars context" are you referring to the Lowest compression Bar object, which in my case the chart base time frame and BarsInprogress=0 ?

          Thanks again
          Jerry

          Comment


            #6
            Correct, you would want to submit it to the primary bars series that you are using.
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              Cal
              thanks

              Jerry

              Comment


                #8
                Originally posted by NinjaTrader_Cal View Post
                Correct, you would want to submit it to the primary bars series that you are using.
                Cal if you can bear with me, I need to make sure I am not reading into what you are telling me.

                If I do the following will I run into problems.

                1) When market is flat and when BinP==Primary Bars I set a temporary Disaster Stop Loss in Ticks and a Temporary Fixed Target in Ticks. i.e. Bracket with SignalName
                Calculation mode Ticks.

                2) When a Setup is triggered on BinP== 3, I enter the Order with same Signalname. I also capture the correct Stop and Profit Prices which are flagged to be processed when BinP==Primary Bars. Note - Stop and Profit calculation mode is now changed to Price. My anticipation is that when the order executes the Stop and Profit are set by ninja to either the Original or Updated values depending on which happens first ( update or execution ) If the execution happens 2nd, I would expect ninja then to update the bracket values.

                To Sum up I am submitting the order with BinP==3 but only using the Set features on BinP== Primary Bars as you indicated and also changing the calculation mode, when I update the values. Is this correct ? or if the order uses via Bracket the Set features must the whole submission including the Order take place with BinP==Primary Bars?

                Thank for your patience,
                Jerry

                Comment


                  #9
                  Hi Jerry, that should be fine however with the Set()'s I would suggest setting the values always before the Enter() method call is triggered.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Hi Bertrand,

                    The disaster values will always be reset before the Enter Method is triggered. However, they will always need to be updated very quickly either immediately before
                    or immediately following the Enter Method as the correct Stop location for the trade may not be known until after entry,

                    I may be reading into the answers I have been given but I keep detecting their is some kind of an issue here. Could you Either explain or point me to some discussion about this that will more inform me on what I might run into.

                    Thanks
                    Jerry

                    Comment


                      #11
                      Hi Jerry, would unfortunately not have other information to point you to, best usage would be working closely with the TraceOrders feature to get the most detailed debug info for the order sequence.

                      If you have not set a specific value before the Enter() method is called then your set default will take over, the Set's are attached as soon as an execution is seen. You can then of course later on change the stop / targets values once the they are known.
                      BertrandNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by aviat72, Today, 12:41 AM
                      1 response
                      9 views
                      0 likes
                      Last Post NinjaTrader_ChrisSch  
                      Started by _Zero_, 01-06-2020, 01:16 PM
                      2 responses
                      75 views
                      2 likes
                      Last Post CiprianV  
                      Started by RuthB, 05-29-2020, 09:41 PM
                      3 responses
                      33 views
                      0 likes
                      Last Post aviat72
                      by aviat72
                       
                      Started by Jorge.andres.o, Yesterday, 08:22 PM
                      0 responses
                      7 views
                      0 likes
                      Last Post Jorge.andres.o  
                      Started by mtamaku, Yesterday, 06:54 PM
                      0 responses
                      11 views
                      0 likes
                      Last Post mtamaku
                      by mtamaku
                       
                      Working...
                      X