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

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 rocketman7, Today, 01:00 AM
            0 responses
            1 view
            0 likes
            Last Post rocketman7  
            Started by wzgy0920, 04-20-2024, 06:09 PM
            2 responses
            27 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, 02-22-2024, 01:11 AM
            5 responses
            32 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, 04-23-2024, 09:53 PM
            2 responses
            74 views
            0 likes
            Last Post wzgy0920  
            Started by Kensonprib, 04-28-2021, 10:11 AM
            5 responses
            193 views
            0 likes
            Last Post Hasadafa  
            Working...
            X