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:



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

    Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
    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.



            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


                    #10
                    There use to be a Ninjatrader 7 addon that used to do that but im not a programmer too so... But if you can upgrade the program to Ninja 8 would be awesome. Source (https://ninjatrader.com/support/foru...ine-is-crossed).
                    Attached Files

                    Comment


                      #11
                      Hello,

                      For anyone interested in performing this conversion, you can refer to our Code Breaking Changes page of the Help Guide for a guide on converting NinjaTrader 7 scripts to NinjaTrader 8.

                      Code Breaking Changes - https://ninjatrader.com/support/help...ng_changes.htm

                      We would like to encourage the community to share their conversions on our User App Share.

                      Submissions can be made here: https://ninjatrader.com/support/foru...app-submission

                      If you are interested in NinjaScript Consulting services to have a script converted at your request, please let us know and we can have an EcoSystem representative reach out with more information.

                      We look forward to assisting.
                      JimNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by DJ888, 04-16-2024, 06:09 PM
                      6 responses
                      18 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by Jon17, Today, 04:33 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post Jon17
                      by Jon17
                       
                      Started by Javierw.ok, Today, 04:12 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post Javierw.ok  
                      Started by timmbbo, Today, 08:59 AM
                      2 responses
                      10 views
                      0 likes
                      Last Post bltdavid  
                      Started by alifarahani, Today, 09:40 AM
                      6 responses
                      41 views
                      0 likes
                      Last Post alifarahani  
                      Working...
                      X