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

Project EMA line forward

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

    Project EMA line forward

    Hi,
    I don't know if this is possible but I would like to be able to project the line of the EMA forward along it's current direction.I guess you could say, project it's current direction into the future.

    Thanks

    #2
    Originally posted by mlarocco View Post
    Hi,
    I don't know if this is possible but I would like to be able to project the line of the EMA forward along it's current direction.I guess you could say, project it's current direction into the future.

    Thanks
    Do you remember calculus from school? This is effectively the same as drawing a tangent to a curve.

    You need a previous time period to anchor your ray (which is the style you want, I think). You could use the previous bar, but this will be highly unstable. Anyway, if you go n bars back, this is your coding:

    Code:
    DrawRay("My ray" + CurrentBar, [B][I][COLOR="Blue"]n[/COLOR][/I][/B], EMA([I]Period[/I])[[B][I][COLOR="Blue"]n[/COLOR][/I][/B]], 0, EMA([I]Period[/I])[0], Color.Blue);

    Comment


      #3
      Hello,

      Thank you for the question.

      The plots would not be able to be projected past the current bar but you are able to use drawing tools with a negative bars ago to achieve a similar effect, this would include drawing dots or triangles or any of the drawing tools.

      You would need to create a indicator in order to do this, you would also need to create logic to determine what values the dots for example would be placed in the future bars.

      I do not know of anything existing that does this but potentially could be created

      please let me know if I may be of additional assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        Originally posted by mlarocco View Post
        Hi,
        I don't know if this is possible but I would like to be able to project the line of the EMA forward along it's current direction.I guess you could say, project it's current direction into the future.

        Thanks
        Feasible, It is a bit tricky to code the line that plots ahead. A correct solution would require a custom plot. Without a custom plot, you need to scroll the chart forward to be able to see the projection.

        Attached is a screenshot of a quick and dirty sample indicator that requires scrolling, Doing it correctly would take some more time.
        Attached Files

        Comment


          #5
          Thanks for the replies. Looks like I have some playing/testing to do.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by The_Sec, Yesterday, 03:37 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by vecnopus, Today, 06:15 AM
          0 responses
          1 view
          0 likes
          Last Post vecnopus  
          Started by Aviram Y, Today, 05:29 AM
          0 responses
          5 views
          0 likes
          Last Post Aviram Y  
          Started by quantismo, 04-17-2024, 05:13 PM
          3 responses
          27 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          7 responses
          36 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X