Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using drawn line in a Strategy Builder condition.

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

    Using drawn line in a Strategy Builder condition.

    Is it possible to use a hand drawn horizontal line as part of a strategies condition?

    In my strategy, I want to compare a moving average to the price value represented by a line I've placed on the chart (and which is moved from time to time). The strategy is attached to the chart as well.

    I've been using NT(8) for almost 3 months and only know how to build in the Strategy Builder.

    Thanks
    Ken

    #2
    Hello cupir2,
    Thanks for your post.

    Something like this would be possible in the context of C#, but not with the Strategy Builder. Please let me know if you want more information on how to program this manually.

    We can leave this thread open in case another member of the community has more information.
    Last edited by NinjaTrader_JoshG; 10-02-2018, 11:52 AM.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      If you can show me how it's done, maybe I can include it in my script by unlocking the code at some point in its development.

      Thanks
      Ken

      Comment


        #4
        You would need to loop through the objects on your chart. We generally do not create scripts on demand like this but I went ahead and made this sample anyway. This sample demonstrates how to get the time and color of a manually drawn line on the chart and you can change this sample however you like to fit your needs.
        Attached Files
        Last edited by NinjaTrader_JoshG; 10-15-2018, 09:44 AM.
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          Hi Josh,

          Thanks for this code. I appreciate the help while I'm learning. For future code needs and possibly tutoring are you or others available?
          Thanks

          Comment


            #6
            Hello cupir2,

            This is Chris following up on behalf of Josh.

            The NinjaTrader Ecosystem includes a network of third-party NinjaScript consultants who can provide more hands-on support and programming services. You can search our extensive library of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more:You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

            This 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 companies and services 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.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            52 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            130 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            70 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            44 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X