Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Updated 9-28-11: Used a simpler approach for horizontal lines and improved "no alert" message handling so that these messages should always be correctly removed. ========= This indicator will alert when the most recent bar crosses manually drawn lines. Works on lines, rays, horizontal lines, and extended lines. Apply the indicator to a chart and manually [&#8230;]


    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 guillembm, Yesterday, 11:25 AM
        2 responses
        9 views
        0 likes
        Last Post guillembm  
        Started by junkone, 04-21-2024, 07:17 AM
        9 responses
        68 views
        0 likes
        Last Post jeronymite  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        4 responses
        18 views
        0 likes
        Last Post trilliantrader  
        Started by mgco4you, Yesterday, 09:46 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by wzgy0920, Yesterday, 09:53 PM
        0 responses
        10 views
        0 likes
        Last Post wzgy0920  
        Working...
        X