• 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 Tool Alert -> Submit Order (Unlock Code?)

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

    Drawing Tool Alert -> Submit Order (Unlock Code?)

    Is there a way to unlock the code to a drawing tool alert (see attachment)? e.g. current bar touches trend line and a long position is executed from the alert created
    I have used the draw.line command to draw lines on a chart. I want to be able to add my draw.line into an if condition statement but a line is not a bool,int,float,double ect (see attachment).
    Any advice will help thank you.
    Attached Files

    #2
    Hello NT8Newbie,

    While we cannot provide the internal code behind the Alerts window (which is extremely complex), the community can assist with turning your logic into code.

    What is the specific logic you are wanting?

    Detecting when something touches is more technical than when something is crossing or greater than or equal to / less than or equal to.

    Is the trend line the drawing object?
    Is this drawn manually by the user or a drawing object that is drawn automatically when certain criteria are true?

    Is the line always at an exact tick size?

    If not do you want to detect when the current price is within one tick of the trend price?
    For example if the current price minus 1 tick (which is always at tick size) is greater than or equal to the trend price and the current price plus 1 tick is less the trend price?
    Code:
    if (myTrendValue >= Close[0] - (1 * TickSize) && myTrendValue <= Close[0] + (1 * TickSize))
    Is the line horizontal having the same price value for both anchors or is the line at an angle?

    An example that may help you with the logic of finding when the price crosses a line at an angle is the Alert for manually drawn lines made for NinjaTrader 7.
    https://ninjatraderecosystem.com/use...y-drawn-lines/

    This doesn't exist for NinjaTrader 8 as the Alerts window already has the functionality to detect when the price crosses a manually drawn object and can automatically trigger an order to be submitted.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.


    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      The trend line (ray at an angle) would be drawn by the user and would work on all time frames (in ninjatrader drawn lines are not dynamic to different chart time frames e.g. tradingview is) . I would want the CurrentBar[0] or the most recent tick that touches the drawn line to execute the order (just like how the drawing tool alert does it). The issue with the drawing tool alert is that i can not Automate it in a strategy. I would like to use drawing tool alert with my custom ATM strategy e.g. SetTrailStop(), something the drawing tool alert does not provide.

      Comment


        #4
        Hello NT8Newbie,

        The logic of the crossing is the part of the LineAlert indicator for NT7 you would be using in your script that places orders. I am suggesting you learn from the logic of how to detect when the price crosses a line and design your script the same way.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by aslane, Today, 10:53 AM
        0 responses
        3 views
        0 likes
        Last Post aslane
        by aslane
         
        Started by bouncetherubble, Yesterday, 08:42 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by bortz, Yesterday, 08:18 AM
        5 responses
        35 views
        0 likes
        Last Post bortz
        by bortz
         
        Started by GARZONJ, Yesterday, 09:02 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by siroya, Today, 06:32 AM
        4 responses
        20 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X