• 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

  • NinjaTrader_Jim
    replied
    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.

    Leave a comment:


  • Rxxar
    replied
    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

    Leave a comment:


  • NinjaTrader_Jim
    replied
    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

    Leave a comment:


  • nostrasladamus
    replied
    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

    Leave a comment:


  • nostrasladamus
    replied
    Thanks Jim

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

    Leave a comment:


  • NinjaTrader_Jim
    replied
    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.

    Leave a comment:


  • nostrasladamus
    replied
    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?

    Leave a comment:


  • NinjaTrader_DrewO
    replied
    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.

    Leave a comment:


  • nostrasladamus
    replied
    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 ...

    Leave a comment:


  • NinjaTrader_DrewO
    replied
    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

    Leave a comment:


  • nostrasladamus
    started a topic Drawing tools: create lines with alerts

    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!

Latest Posts

Collapse

Topics Statistics Last Post
Started by nikolaalx, Today, 07:31 AM
6 responses
21 views
0 likes
Last Post bltdavid  
Started by HiddenPhilosopher, Today, 09:28 AM
0 responses
9 views
0 likes
Last Post HiddenPhilosopher  
Started by tipslark, Today, 07:23 AM
0 responses
18 views
0 likes
Last Post tipslark  
Started by Grantx, Today, 06:49 AM
0 responses
12 views
0 likes
Last Post Grantx
by Grantx
 
Started by muhuzekob, Today, 05:59 AM
0 responses
7 views
0 likes
Last Post muhuzekob  
Working...
X