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

Displacement - plotting into future

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

    Displacement - plotting into future

    Is there a way to be able to plot (draw) an indicator into the future. For instance if I have displacement of 100 on an EMA(5) and I go to the chart / indicator panel and set the displacement property to 100, it plots (draws) past the last price bar (well into the right hand side) .

    However when I create an indicator using code, it stops and does not print past the last price bar.

    For instance EMA(5) with a displacement set to 100 prints into the future (see green line - this is what I want to happen, I need to replicate this with a complex "coded" indicator.)

    However EMA(5)[100] stops and does not print past the last price bar. (see blue line)
    Value.Set(EMA(Period)[100]);

    What's the solution for having the coded indicator print into the future?
    Attached Files
    Last edited by pureporsche; 07-23-2010, 02:54 PM.

    #2
    pureporsche,

    Displacement is a visual displacement only. It does not change the underlying data. As such all of the underlying data is still exactly the same and you should not be trying to set your plot value to index [100]. That would just mean you are truncating the rest of your data.

    If you wanted to automatically program a displacement you should just use Displacement = 100 in the Initialize() method of the indicator.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Visual is all I'm looking for.

      That said, from what I hear I need to create a complex indicator so that it displaces it -100 and then through the indicator box I push it out 100 to get the visual behavior I want.

      Actually I just did that, and have the result I was looking for.
      Thx for the "brain-jar"

      Comment


        #4
        Enabling Displacement in Strategies

        Josh.... how can I use the Displacement property of the Indicator Methods in a Strategy. I need to displace an indicator a few periods into the future, and have the stategy act on it.

        Thanks.
        Last edited by rperez; 08-15-2010, 09:52 PM.

        Comment


          #5
          rperez, just reference the indicator value of x bars ago then for your conditions, delaying the indicators into the future means just delaying the signal.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Enabling Displacement in Strategies

            Sorry Bertrand, I didn't quite understand your point. For example, I'd like my strategy to signal crossovers of the 4EMA and 5EMA, having the 4EMA show the actual data, and the 5EMA displaced 5 periods into the future, as per the screenshot. The blue is the 4EMA and red is 5EMA
            Attached Files

            Comment


              #7
              rperez, then you would need to compare the acutal 4 EMA value with the 5 EMA value 5 periods back, this is what you see when you 'displace' it 5 bars into the future.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Thanks Bertrand

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by f.saeidi, Today, 12:14 PM
                2 responses
                5 views
                0 likes
                Last Post f.saeidi  
                Started by TradeForge, 04-19-2024, 02:09 AM
                2 responses
                28 views
                0 likes
                Last Post TradeForge  
                Started by aprilfool, 12-03-2022, 03:01 PM
                3 responses
                327 views
                0 likes
                Last Post NinjaTrader_Adrian  
                Started by giulyko00, Today, 12:03 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by AnnBarnes, Today, 12:17 PM
                1 response
                2 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Working...
                X