Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TrendLine

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

    TrendLine

    Is there a way to return the price value of a trend line at the current bar?

    I have the value of the swing highs and lows in the strategy.

    The trend line is based on the high and low close of the bars not the actual high and low. The tails and wicks of the bars are causing too many "false trend lines".

    I was trying to modify the trendline indicator as it does what I need with the exception of using the close of the bars. I have not been successful.


    Thank you

    #2
    Hello sdauteuil,

    Thank you for the post.

    You could access that from another script by using the plot it exposes. It looks like there is also some logic inside the trendline indicator checking for crossing in realtime, you could likely use it in a similar way from other scripts.

    To access a plot value from the current bar you would use [0] for the BarsAgo.


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

    Comment


      #3
      Do you mean using something like DrawLine() in my strategy?

      Or are do you mean accessing the plot from the trendline indicator?

      Comment


        #4
        Hello sdauteuil,

        Thank you for the post.

        I was referring to accessing the plot of the trendline indicator, it exposes 1 plot and uses that plot for its alert conditions.


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

        Comment


          #5
          The problem I have with the trendline indicator is that the values it uses to create the trendline are based on the actual high and low of the bar.

          I need to have the trendline drawn from the closing values of the bar. So if the bar closes at a new high or low the closing value of the bar would be the value for creating the trendline.

          Using the trendline indicator as it is returns too many trendline changes. I have tried increasing the strength value of the indicator which does help somewhat.

          I have my strategy code calculating the respective values I need but I am not sure how to create the trendline and obtain the value at the current bar.
          I was trying to figure out if I could alter the indicator code to use my values or if there was some other way to accomplish this.

          Hope that makes sense.

          Thank again

          Comment


            #6
            Hello sdauteuil,

            If your strategy already calculating the value you need to use then it would likely be easiest to copy that logic into the indicator. You could then use the calculated value in whatever way you wanted in the indicators calculations.

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

            Comment


              #7
              That is what I was attempting but I couldn't figure how the high and low values were being calculated.

              I see now that they are being pulled from the Swing indicator.

              Thanks again

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by DeskTroll, Today, 12:09 PM
              3 responses
              22 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by Pabulon, 12-02-2024, 03:42 PM
              14 responses
              90 views
              0 likes
              Last Post Pabulon
              by Pabulon
               
              Started by tfa2806trader, Today, 12:04 PM
              10 responses
              25 views
              0 likes
              Last Post tfa2806trader  
              Started by trdninstyle, 11-26-2024, 12:23 PM
              62 responses
              186 views
              0 likes
              Last Post trdninstyle  
              Started by lorien, 08-08-2021, 07:33 AM
              12 responses
              722 views
              0 likes
              Last Post AndyM871  
              Working...
              X