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 ZenCortexCLICK, Today, 04:58 AM
                      0 responses
                      2 views
                      0 likes
                      Last Post ZenCortexCLICK  
                      Started by sidlercom80, 10-28-2023, 08:49 AM
                      172 responses
                      2,280 views
                      0 likes
                      Last Post sidlercom80  
                      Started by Irukandji, Yesterday, 02:53 AM
                      2 responses
                      17 views
                      0 likes
                      Last Post Irukandji  
                      Started by adeelshahzad, Today, 03:54 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post adeelshahzad  
                      Started by Barry Milan, Yesterday, 10:35 PM
                      3 responses
                      13 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Working...
                      X