• 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

Drawing tools: create lines with alerts

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

    Drawing tools: create lines with alerts

    Hi,

    Is it possible to create some lines with Drawing tools, and that some of these created lines have an alert?

    Thks!

    #2
    nostrasladamus,

    Thanks for posing.


    In NinjaTrader 8, you can use the native Alerts feature to trigger alerts based on items on the chart, such as drawing tools. Alerts can be configured using certain conditions within the platform to display a pop-up message, play a sound, trigger an order, etc. More information at the below link:

    http://ninjatrader.com/support/helpG...-us/alerts.htm

    We also have comprised a video going over some Alerts examples at the below publicly available link:

    https://www.youtube.com/watch?v=gR_3ohHMlYY
    Drew O.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your answer,

      I knew this.
      My question is, if it is possible, to include some instructions in the drawing tool, so that the alert will be created athomatically:
      Imagine I draw a Fibonacci retracement, and I have implemented an alert so, that when the price crosses the 50% retracement it sends an alert.
      And this is done only with picking two points of the chart from the fibonacci drawing tool..... (because I always send the same alert ...

      Comment


        #4
        nostrasladamus,

        Thanks for replying.


        This would require custom programming. Programmed alerts can be set with a drawing tool by default, but normal chart alerts cannot be set up by default with a Drawing tool.
        Drew O.NinjaTrader Customer Service

        Comment


          #5
          Thanks,

          Do you mean, if I programm my own drawing tool, I can set an alert inside my drawing tool code?
          Where can I find info about programming alerts?

          Comment


            #6
            Hello nostrasladamus,

            If you are programming your own Drawing Tool, and would like to have the Drawing Tool fire alerts automatically, you could use the AddOn code for firing Alerts. Please see below.

            https://ninjatrader.com/support/help...g_concepts.htm

            In order to access price data from the Drawing Tool, you can use GetAttachedToPriceBars. This will return a ChartBars object which will then allow you to access the Bars object within ChartBars.
            From here, you can use (GetAttachedToChartBars().Bars.GetClose(BarIndex) to get the close at a given index. As an example, the following print will print the current Close value on the chart.

            Print(GetAttachedToChartBars().Bars.GetClose(GetAt tachedToChartBars().Bars.Count-1));

            This logic would then be implemented in the Drawing Tools OnRender method. Be advised, OnRender will process each time the chart needs to update. We will see frequent calls to OnRender when the user interacts with the chart to scroll it or change the scale. We normally would not suggest baking the alerts into the Drawing Tool for this reason, but if you intend on doing this, I strongly suggest using logic that checks if the price changes before checking the logic to fire your alert.

            Let us know if you have any additional questions.
            JimNinjaTrader Customer Service

            Comment


              #7
              Thanks Jim

              It sounds very interesting
              I'll try to follow your recommendations (I'm not an expert programmer

              Comment


                #8
                Hi,

                Maybe then I could set the alert under "OnMouseDown" void, or under "OnMouseUp" void?

                What is done in each of these voids?
                And what is done in the "OnRender" one?

                I've done some dwg tools, but copying the existing ones, and I would be very nice if you could send me here some help

                Comment


                  #9
                  Hello nostrasladamus,

                  Thanks for your post.

                  These methods pick up on when the left mouse button is pressed to a down position and is returned to an up position. I have attached a clone of the Lines Drawing Tool that has most of the code removed and has prints added so you can observe how the code gets processed and get a better idea on how the Drawing Tool works. The Mouse states are typically used to transverse through DrawingStates and to place anchors.

                  OnRender is used to actually draw the line or object. You can reference our SampleCustomRender example and the documentation below for further information on SharpDX rendering.

                  Using SharpDX for custom rendering - https://ninjatrader.com/support/help..._rendering.htm

                  We look forward to assisting.
                  Attached Files
                  JimNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by bboyle1234, Today, 01:06 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post bboyle1234  
                  Started by Sulfred, Today, 12:34 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post Sulfred
                  by Sulfred
                   
                  Started by U0000999, Today, 12:27 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post U0000999  
                  Started by radist, Today, 12:13 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post radist
                  by radist
                   
                  Started by mntemel, Yesterday, 10:25 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post mntemel
                  by mntemel
                   
                  Working...
                  X