Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

draw-remove

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

    draw-remove

    Hello,

    I found in the forum the information concering the question of a fellow how to remove a certain horizontal line to do with

    IHorizontalLine hLine = this.DrawHorizontalLine("line", Close[0], Color.Green);
    this.RemoveDrawObject(hLine);

    Why to do this way?

    When drawing with DrawHorizontalLine (Line1" + Current Bar,.............) one can remove later with RemoveDrawObject("Line1");

    No? Thanks for your reply.

    Another question in this concern. On the support sites all samples for drawing are with High[0] + y TickSize or Low [0] - y TickSize. I didnt find how to draw the horizontalline in a script at the current price position - eg to draw the horizontal line same time as the entry is realized to see the entry price during the trade (because chart trader can not be enabled with strategies)

    Thanks
    Tony

    #2
    tonynt,

    Either way would work here, drawing the actual draw object just gives you more control over the draw object if needed but it isn't necessary to use the other method you found.

    As far as your other question, strategies should plot these lines if you attach them to your chart and have the "Plot Executions" set appropriately in your "Dataseries" menu.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Adam,

      thank you for your reply.

      Referring the drawing of the horizontal line at entryprice I do not understand what you mean. What do I have to change in my "DrawHorizontalLine("Line1" + Current Bar, true, Low[0]-2+TickSize, Color.White, DashStyle.Dash,2);" when I dont want to have drawn the line at Low [0] or below Low [0] BUT at the price where entry is done?

      Thanks
      Tony




      Originally posted by NinjaTrader_AdamP View Post
      tonynt,

      Either way would work here, drawing the actual draw object just gives you more control over the draw object if needed but it isn't necessary to use the other method you found.

      As far as your other question, strategies should plot these lines if you attach them to your chart and have the "Plot Executions" set appropriately in your "Dataseries" menu.

      Comment


        #4
        tonynt,

        So you don't want to use the "Chart trader" style order plots? These should plot if you use the correct setting.

        Otherwise, please clarify : Are you trying to plot a horizontal line where your orders close or where they are entered?
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Adam,

          I would like to have the same informations as one would have with chart-trader. As one can not acitvate chart trader when strategies are running I want draw horizontal lines at the entry, at my stops and targets.

          Or what you mean with "Chart Trader Style orde plots"?? Yes, I would like to have this on my chart with NT-script-strategies of course - if possible. How could I do this?

          Thanks
          Tony


          Originally posted by NinjaTrader_AdamP View Post
          tonynt,

          So you don't want to use the "Chart trader" style order plots? These should plot if you use the correct setting.

          Otherwise, please clarify : Are you trying to plot a horizontal line where your orders close or where they are entered?
          Last edited by tonynt; 10-09-2012, 09:20 AM. Reason: clearify

          Comment


            #6
            TonyNT,

            Please see the Capture screenshot. If you right click your chart > go to "Strategies" > You can add a strategy to your chart, and set the "Enabled" field to "True". As you can see, when I hit the "Apply" button the chart is now showing a strategy running on it and an order was plotted for when it entered and exited.

            Please see the Capture2 screenshot. If you right click your chart > go to "DataSeries" > You can set the "PlotExecutions'" field to "TextAndMarker" to get these order plots.
            Attached Files
            Adam P.NinjaTrader Customer Service

            Comment


              #7
              Adam

              what are we talking about? You tell me how to enable a strategy? And you tell me how to set PlotExecutions?

              This would be the answer to the question how I can enable a strategy and to the question where I set "plotexecutions".

              I asked how I can plot a Horizontal Line exactly at the price where the entry is done. Isnt this something different from your answer?

              Your answer even doesnt refer to your question that I confirmed "Are you trying to plot a horizontal line where your orders close or where they are entered? "

              Best
              Tony

              Originally posted by NinjaTrader_AdamP View Post
              TonyNT,

              Please see the Capture screenshot. If you right click your chart > go to "Strategies" > You can add a strategy to your chart, and set the "Enabled" field to "True". As you can see, when I hit the "Apply" button the chart is now showing a strategy running on it and an order was plotted for when it entered and exited.

              Please see the Capture2 screenshot. If you right click your chart > go to "DataSeries" > You can set the "PlotExecutions'" field to "TextAndMarker" to get these order plots.
              Last edited by tonynt; 10-09-2012, 10:22 AM.

              Comment


                #8
                tonynt,

                I would like to have the same informations as one would have with chart-trader. As one can not acitvate chart trader when strategies are running I want draw horizontal lines at the entry, at my stops and targets.
                From this I am interpreting your meaning as you want to orders to be drawn on your chart as if they were drawn like in ChartTrader. This can already be done with the steps I showed you.

                Do you also want to draw a horizontal line below or above the current price, from where an order entered and exited?
                Adam P.NinjaTrader Customer Service

                Comment


                  #9
                  Adam,

                  yes I confirm

                  YES I WANT also to draw a horizontal line below or above the current price, from where an order entered and exited.

                  BUT not below Low[0] or above High[0] of the bar - I want to draw at the current price where an order is entered and exited.

                  Thanks
                  Tony


                  Originally posted by NinjaTrader_AdamP View Post
                  tonynt,



                  From this I am interpreting your meaning as you want to orders to be drawn on your chart as if they were drawn like in ChartTrader. This can already be done with the steps I showed you.

                  Do you also want to draw a horizontal line below or above the current price, from where an order entered and exited?

                  Comment


                    #10
                    TonyNT,

                    Unfortunately what you are asking is a bit more complicated than a one-liner here. Likely you will want to keep track of your Order object using IOrder.

                    http://www.ninjatrader.com/support/h...nt7/index.html

                    Then monitor when the order executes its entry and exit, as well as keeping tracking of what price the execution occurred at using OnExecution :

                    http://www.ninjatrader.com/support/h...nexecution.htm

                    You can then use the prices you stored to draw your lines.
                    Adam P.NinjaTrader Customer Service

                    Comment


                      #11
                      Adam,

                      thank you for your reply.

                      so, please answer me only the first question:

                      how can I do "drawhorizontalline" exactly at the current price and not as shown in all the samples on the website with Low[0] or High[0].

                      Only to draw at the current price (Ask, Bid, no matter) but not at the close, high or low of bar.

                      Thanks
                      Tony

                      Originally posted by NinjaTrader_AdamP View Post
                      TonyNT,

                      Unfortunately what you are asking is a bit more complicated than a one-liner here. Likely you will want to keep track of your Order object using IOrder.

                      http://www.ninjatrader.com/support/h...nt7/index.html

                      Then monitor when the order executes its entry and exit, as well as keeping tracking of what price the execution occurred at using OnExecution :

                      http://www.ninjatrader.com/support/h...nexecution.htm

                      You can then use the prices you stored to draw your lines.

                      Comment


                        #12
                        Tony,

                        You could do something like this :

                        DrawHorizontalLine("MyLine", GetCurrentBid() , Color.Green);

                        Or you can trade "GetCurrentBid()" with "GetCurrentAsk()"

                        OR "Close[0]" if CalculateOnBarClose = false since this will be the "last" price.
                        Adam P.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by tonynt View Post
                          Adam,

                          thank you for your reply.

                          Referring the drawing of the horizontal line at entryprice I do not understand what you mean. What do I have to change in my "DrawHorizontalLine("Line1" + Current Bar, true, Low[0]-2+TickSize, Color.White, DashStyle.Dash,2);" when I dont want to have drawn the line at Low [0] or below Low [0] BUT at the price where entry is done?

                          Thanks
                          Tony
                          So change the Low[0]-2+TickSize to your entry price. Am I missing something here?

                          Comment


                            #14
                            koganam,

                            thanks for your reply.

                            Yes, this was the simple question at the beginning and the easy solution. I wrote in every post "DrawHorizontalLine" but from NT-support I got the answer how to draw the arrows for entries and exits (which of course are drawn by NT, and no need to to in a script) therefore the discussion.

                            So, I try to draw the entries,stops and targets with lines in my script (like visible if you would do the trade with charttrader). But I still have the issue that eg my DrawHorizontalLine("E",.....); is not removed from the chart eg
                            ...when flat.... RemoveDrawObject("E");

                            My HorizontalLines are there forever;-)

                            Any hint for me how to remove? Thanks in advance.

                            Best
                            Tony
                            Last edited by tonynt; 10-11-2012, 02:44 AM. Reason: clearify

                            Comment


                              #15
                              Tony, if you drawn lines are not removed properly, there would be 2 areas to check into -

                              a) the tag being used for the drawing object
                              b) the condition to remove
                              BertrandNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Rubix, Today, 09:31 PM
                              0 responses
                              13 views
                              0 likes
                              Last Post Rubix
                              by Rubix
                               
                              Started by ark321, Today, 05:12 PM
                              1 response
                              19 views
                              0 likes
                              Last Post NinjaTrader_EricB  
                              Started by futurenow, Today, 09:08 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post futurenow  
                              Started by ezrollin, Today, 08:51 PM
                              0 responses
                              12 views
                              0 likes
                              Last Post ezrollin  
                              Started by fafafdenis, Today, 04:56 PM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_EricB  
                              Working...
                              X