Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MTF + Swing + Draw.Ray + CrossAbove

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

    #16
    Hello Amedeus,

    Drawing objects will appear on the bar it is within the time of when the drawing method is called. Which also means that historical may be different than real-time depending on if TickReplay is enabled.

    What is the Time[0] when the draw method is called?

    What is the close time of the bar the drawing object appears on?

    A drawing object, drawn intra-bar (such as with Calculate.OnEachTick with TickReplay enabled) in OnBarUpdate when IsFirstTickOfBar is true, would appear on the last bar and not the previous bar.


    As far the prices, are you printing the price submitted to the draw method (the price of the execution from what I understand) to the output window and this is not matching the price of the drawing object on the chart?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      hey Chelsea, thank you,

      ok about 1 bar displacement because it's historical and on bar close.

      prints are in the pictures,
      we got one triangle left that remains unexplained.

      about MAX not beeing plotted, it's just because it does not have the full collection and just a brush ? Is it so obvious when adding both manually on the chart ?
      Attached Files
      Last edited by Amedeus; 07-14-2021, 02:44 PM.

      Comment


        #18
        Hello Amedeus,

        What is the Time[0] when the draw method is called?
        What is the price submitted to the draw method?
        What is the close time of the bar the drawing object appears on?
        What is the price and time showing for the drawing object in the Draw objects window?

        I was wrong about MAX, this actually does have a plot.

        What collection are you referring to?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Hey Chelsea, thank you,

          I meant the collection from the definition of Plots, from the help guide. NinjaTrader 8

          the Draw Object window gave the same prices and times than the output.

          Either I should place the print elswhere,
          or you ask me twice the same things, as it was not enough for me to figure it out the first time,

          I understand better granularity would have better result, but how come - with OnBarClose - do ExecUpdate detects what OrderUpdate did not ?
          Of course the answer resides in the processing, but can this be put into words ?
          Am I just missing out with the print.
          Attached Files
          Last edited by Amedeus; 07-14-2021, 07:00 PM.

          Comment


            #20
            Hey Chelsea,

            Let me know if this picture doesn't explains it.

            thank you very much, nice study that we did.
            it's not there yet but we can see the ease slowly coming.

            I'll think about the swing with an added dataseries, but it looks a bit complex even without plot considerations, to adapt such a big code.
            Attached Files

            Comment


              #21
              Hello Amedeus,

              The Plots collection is inherent to all indicators. Indicators that don't add plots still have a Plots collection. This will simply have 0 elements.
              Below is a link to the help guide on the Plots collection.


              To save the output from the output window and share this, right-click the output window -> select Save As -> click OK.
              Below is a link to a forum post that demonstrates how to use prints to understand behavior that states this.


              Your screenshots have a lot going on. I think maybe you might be overthinking it. The drawing object is going to appear on the bar is drawn on. We just need to check when its drawn from the output and compare this to the Draw objects window and the data box for the bar on the chart.

              Can you answer the questions from post #18 in text with just the requested numbers?
              Chelsea B.NinjaTrader Customer Service

              Comment


                #22
                Hey Chelsea, thank's

                for the specific bar who draws one execution and zero order :

                What is the Time[0] when the draw method is called?
                16:41:25

                What is the price submitted to the draw method?
                2213.7

                What is the close time of the bar the drawing object appears on?
                16:41:25

                What is the price and time showing for the drawing object in the Draw objects window?
                2213.7 and 16:41:25
                Attached Files

                Comment


                  #23
                  Hey again,

                  coming back on one point :

                  I am not sure this answered question was well formulated and understood :
                  -Would there be a shorter/more efficient way to write this "high and low points definition" ?

                  The swings are in the plots which are retrieved with barsAgo values. There wouldn't be a more efficient way (or another way) of getting those plot values.
                  I formulated it more precisely in the picture.
                  Was it how you initially interpreted the question ?

                  another angle to the same question could be :
                  is it worth and easy to make a list from "this basis" ? what would it look like ?
                  Attached Files

                  Comment


                    #24

                    hey Chelsea,

                    what is "a lot going on from the screenshots" ?

                    Overall we try to draw a triangle over an execution marker when there is one (-1 bar if historical)

                    if an unexpected event like an extra triangle happens, we are trying to expose the cause behind it. With prints if that's a good and appropriate way.
                    Attached is the printing operation attempting to expose this cause, reworked and better organized. Also attached is its result applied on chart.

                    In the 3rd attachment, we see that our lead cause just got crushed : the extra triangle is NOT drawn because it is the execution of the stop only(or at all ?).




                    if overthinking would be here disect or break down how/why a specific event happens, then we definitely are doing that.
                    that is what's happening...

                    I definitely suspect we should have a simple reason behind the extra triangle.
                    I definitely suspect we should have a simple way of drawing a triangle over the execution markers, NOT MORE OR LESS. (I believe we're almost there, are we not?)

                    There are tons of super obvious basic things that I must miss, groping would also accurately define what's happening.
                    Remember in post#15, I did not instantly figured the EnterLimit at the line would be entered at a lesser price. It tells a lot.
                    It took me some time to get there (lol), before adapting the condition for a better appropriate example.

                    I bet an expansion of "a lot going on from the screenshots" would be very much enlightning, maybe not only regarding the triangle.
                    Attached Files

                    Comment


                      #25
                      Hello Amedeus,

                      The screenshot appears to have a trading plan or something and is not just showing the data box with the time of the bar along with the output from prints.

                      Its very helpful to simply to only the issue at hand, until that one issue is resolved before moving on to another issue.

                      Where you mention:
                      "is it worth and easy to make a list from "this basis" ? what would it look like ?"

                      Do you mean a List<double> object? Is this necessary for your custom logic? Do you need to remember a large amount of values or are you just getting two values with bars ago numbers?

                      Using a List<double> object might be what you need but would add complexity.
                      Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.



                      The issue at hand is a drawing object is not appearing on the bar the time of the drawing object is showing when compared to the close of time of the bar, is this correct?
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #26
                        Hey Chelsea, thank you,

                        Could "a trading plan" be a stop and target ? otherwise it's intriguing.

                        The issue at hand is :

                        a drawing object is appearing as an execution when the stop is hit, while it does not appear with 95% of the other stops beeing hit.
                        Last edited by Amedeus; 07-15-2021, 05:41 PM.

                        Comment


                          #27
                          Hello Amedeus,

                          In an effort to get on the same page, I have created a modification of the SampleOnOrderUpdate strategy that adds a a single tick data series for intrabar granularity and draws arrows from OnExecutionUpdate.

                          I am seeing drawing objects appear where I would with this example. If this does not resolve your inquiry, please modify the example so it demonstrates the issue at hand so we can provide further insight.

                          We look forward to assisting.
                          Attached Files

                          Comment


                            #28
                            Hi Jim and Chelsea, and everyone,

                            Setting up example orders via the managed approach, like demonstrated with the sample, in a very simple and academic way.
                            It was time to study the order management, thank you very much Jim. I can't procrastinate this any longer, it's been a while.
                            We are trying to configure 3 additionnal orders, the intend is to make them behave as if a SetStopLoss() SetStopTarget() method would do.

                            Can anyone tell the reason why entryA is exited with StopA one time and not the other time ?
                            edit : can anyone tell why entryC is exited stopA and entryA exited with Sell (empty name) ?
                            eventually remark anything inconsistent with that regard of 'copying' what a SetStopLoss would do.
                            or remark anything in general that could be ameliorated.

                            attached are the script, chart and output, of what seemed relevant.
                            Attached Files
                            Last edited by Amedeus; 07-19-2021, 08:25 AM.

                            Comment


                              #29
                              Hello Amedeus,

                              If there are multiple exit orders using the same fromEntrySignal the order with the price that is reached first would fill and the others would automatically be cancelled.

                              If you are wanting to know what orders are working enable TraceOrders and print the order object from OnOrderUpdate().

                              Below is a link to a forum post that discusses TraceOrders and using prints to understand behavior.
                              https://ninjatrader.com/support/foru...040#post786040

                              If you are wanting to know why an order would be submitted without a signal name, look for any order method calls that do not supply a signal name.


                              In the output you have provided, are you referring to the execution at 2021-07-16 15:47:43?
                              execution='NT-00648-11411' instrument='M2K 09-21' account='Sim101' exchange=Default price=2199 quantity=1 marketPosition=Short orderId='NT-01315-11411' time='2021-07-16 15:47:43' sod=False statementDate='0001-01-01'
                              execution.Order.Name : MyStopA | .Quantity : 1 | .Filled : 1 | .OrderAction : Sell | .OrderType : StopMarket | .LimitPrice : 0 | .StopPrice : 2199,4

                              Are you finding that the price did not reach 2199,4 and that this order should not have filled?
                              Last edited by NinjaTrader_ChelseaB; 07-19-2021, 08:56 AM.
                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                #30
                                Hey Chelsea and Jim and everyone,

                                An empty fromEntrySignal was too messy here.

                                Thank you very much for the help.

                                Attached is the result sample of what we did in this thread :
                                - brilliant projection of the swing slopes
                                - standard managed orders handling
                                - very accurate printing of orders and executions
                                - very accurate drawing of orders and executions
                                - additional super basic brushes stuff initiation

                                Anyone is welcome to let me know if this descritption is illegitimate, providing evidence of course.
                                SandBox guys can find here a good all in one sample.

                                **

                                Also, is there a good reason that this condition (attachment pic) does not write a 2 decimal number ?
                                Is this condition not showing the profit of the trade on the chart, but something else ?

                                Finally, If I intend to have a try at something about the swing, for a use with a second dataseries of a strategy, and encounter an issue,
                                should we keep going here or should I go see the indicator team with a new indicator thread ?
                                Attached Files

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by NullPointStrategies, 03-13-2026, 05:17 AM
                                0 responses
                                95 views
                                0 likes
                                Last Post NullPointStrategies  
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                153 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                80 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                54 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                70 views
                                0 likes
                                Last Post TheRealMorford  
                                Working...
                                X