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

Trendline Indicator in Strategy.

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

    Trendline Indicator in Strategy.

    Hi All,
    I am trying to use Trendline indicator in Strategy Builder but while running the strategy it does not works , can anyone please guide on the same.
    Thanks in advance.

    #2
    Hello tausifkhan,

    Welcome to the NinjaTrader support forums.

    I wanted to confirm, are you referring to the "TrendLines" indicator that comes with NT8?

    The TrendLines that comes with the platform may not work as you would expect in contrast to NinjaScript, the plot which is used in this indicator is not exposed as a signal and is just being used to control the alerts. The actual trend line being drawn uses other logic in the script to calculate its placement. Because of this the plot which the indicator has very likely could not be used as a signal for the purpose of matching the drawn trend line.


    I look forward to being of further assistance.


    JesseNinjaTrader Customer Service

    Comment


      #3
      I want buy signal to be generated when candle closes above the trendline created in NT8 , how to achieve it now ?

      Comment


        #4
        Hello tausifkhan,

        Thank you for clarifying.

        To achieve this would require manual programming unfortunately. To use the actual drawn line it would require either correctly exposing the values from the indicator so the strategy knows the actual line prices or you would need to use the drawing objects collection to locate the line and check its value. Both of these tasks would need to be completed in manual coding unfortunately.



        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Jesse, Sounds interesting. Is there a code sample or a guideline for coding the a moveable trendline in Ninjascript you can point me to? Thanks.

          Comment


            #6
            Hello designer01,

            There is not any type of guide or tutorial for that. If you are asking how to edit the existing trend line indicator you would need to add code which uses the private highTrend or lowTrend variables, those are the actual objects it uses for the pricing. If you mean to code your own movable line that depends on what you mean, are you referring to manually drawing lines in some way?
            JesseNinjaTrader Customer Service

            Comment


              #7
              One option will be to modify the default NT8 Trendline indicator to be drawn based on coordinates rather than preset High and Lows?
              This is a video sample of what I am trying to achieve. Yes it's possible to be a manually drawn line if that is achievable by coding . See video link below.

              https://www.ninjacators.com -- FREE NinjaTrader indicators every month. Join Ninjacators' FREE Indicator of the Month Club, and join our YouTube Channel to g...
              Last edited by designer01; 06-12-2023, 11:57 AM.

              Comment


                #8

                Hello designer01,

                Making a trendline based on coordinates from the chart would require using OnRender. The existing indicator does not use coordinates but instead uses bar events and prices. If you wanted to work with chart coordinates and also draw items manually you would be looking at creating a drawing object instead of using an indicator. The drawing objects work based on mouse events and then use OnRender to draw on the chart.

                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Spiderbird, Today, 12:15 PM
                2 responses
                10 views
                0 likes
                Last Post Spiderbird  
                Started by WHICKED, Today, 12:45 PM
                0 responses
                3 views
                0 likes
                Last Post WHICKED
                by WHICKED
                 
                Started by FrazMann, Today, 11:21 AM
                2 responses
                6 views
                0 likes
                Last Post NinjaTrader_ChristopherJ  
                Started by rjbtrade1, 11-30-2023, 04:38 PM
                2 responses
                80 views
                0 likes
                Last Post DavidHP
                by DavidHP
                 
                Started by lorem, Yesterday, 09:18 AM
                5 responses
                18 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X