Projecting a Moving Average - NinjaTrader | futures io social day trading
futures io futures trading


Projecting a Moving Average
Updated: Views / Replies:7,371 / 30
Created: by vegasfoster Attachments:7

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 7  
 
Thread Tools Search this Thread
 

Projecting a Moving Average

  #11 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


NJAMC View Post
@Fat Tails,

So you are saying the projected value (next bar or whatever) would simply be stored under the current bar index [0], but simply offset on the chart? Is there a parameter that can be loaded in the Init to set the offset?

I was not saying anything.... I just showed how to add a projection period in the end of the indicator.

The indicator uses the displacement feature of NinjaTrader. In order to display a plot, which extends into the future, I used the following approach

-> determine the number of bars N that you want to produce a forecast for
-> shift the plot N bars to the right by selecting a displacement equal to the forecast period - do not try to do this in Initialize(), you need to set the Displacement in OnStartUp()
-> correct the values up to CurrentBar - N to compensate for the impact of the shift
-> add the forecast values for the last N bars by using the selected algorithm

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #12 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received

Thanks for the responses, but I didn't appear to successfully convey my thought process. I want to displace all bars back one bar, including the current bar, and then insert another current bar so that both the current bar and previous bar will both use the last price. I am not actually trying to project or forecast what I think the value of the moving average will be at the end of the next bar based upon what has happened. I just want to know if the price were to close right now, what would the value be at the open of the next bar. It's not the same value as the close of the current bar, because the last bar in the current series will drop off at the open of the next bar. Hope that makes sense. Again, thanks for any help.

Reply With Quote
 
  #13 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received



Fat Tails View Post
Here is a little indicator that adds a linear forecast to any indicator plot that is selected as input series. The chart below shows the LinearForecast indicator applied to each of the 3 MACD Plots.

Of course it is possible to recode any indicator to include this little feature. You can also modify the linear forecast indicator to allow for different algorithms to extrapolate the plot values.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Sorry, I didnt see this post before making my last post, lemme see if this will help me, thank you very much.

Reply With Quote
 
  #14 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received

Hmmm, thanks for posting and correct me if I am wrong, but I don't think the analinearforecast is what I am trying to do.

Reply With Quote
 
  #15 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


vegasfoster View Post
Thanks for the responses, but I didn't appear to successfully convey my thought process. I want to displace all bars back one bar, including the current bar, and then insert another current bar so that both the current bar and previous bar will both use the last price. I am not actually trying to project or forecast what I think the value of the moving average will be at the end of the next bar based upon what has happened. I just want to know if the price were to close right now, what would the value be at the open of the next bar. It's not the same value as the close of the current bar, because the last bar in the current series will drop off at the open of the next bar. Hope that makes sense. Again, thanks for any help.

@vegasfoster: Yes, this is something different. Moreover, you confused us, because the MultiCharts example that you used showed a linear projection, which is what I have done for NinjaTrader.


Here comes another indicator, which is probably the DIRTIEST and the SHORTEST piece of code that was ever written for NinjaTrader. Don't insult me, if it does not work.

To be used with CAUTION. No warranties given.


The code can be used to predict the indicator values for the coming 3 bars by using the close of the current bar as the numerical base for the forecast of the following indicator values.


This is how the indicator is to be applied: If you want the prediction feature, just apply your indicator and select ana3BarPredictor as the input series. Also set the displacement manually to 3 via indicator dialogue box.


Attached is a chart that shows the predicted values for the RSI.


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Attached Files
Register to download File Type: zip 3BarPredictor.zip (1.5 KB, 101 views)
Reply With Quote
The following 8 users say Thank You to Fat Tails for this post:
 
  #16 (permalink)
Elite Member
Atkinson, NH USA
 
Futures Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker/Data: NinjaTrader Brokerage
Favorite Futures: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,925 since Dec 2010
Thanks: 2,962 given, 2,294 received


Fat Tails View Post
@vegasfoster: Yes, this is something different. Moreover, you confused us, because the MultiCharts example that you used showed a linear projection, which is what I have done for NinjaTrader.

Here comes another indicator, which is probably the DIRTIEST and the SHORTEST piece of code that was ever written for NinjaTrader. Don't insult me, if it does not work.

To be used with CAUTION. No warranties given.

The code can be used to predict the indicator values for the coming 3 bars by using the close of the current bar as the numerical base for the forecast of the following indicator values.

This is how the indicator is to be applied: If you want the prediction feature, just apply your indicator and select ana3BarPredictor as the input series. Also set the displacement manually to 3 via indicator dialogue box.

Attached is a chart that shows the predicted values for the RSI.

Okay @Fat Tails,

What kind of black magic is this? How does [-3] even exist, and how does the RSI use this to forecast 3 bars ahead!?!?!?

 
Code
        protected override void OnBarUpdate()
        {
            try
            {    
                Value.Set(Input[-3]);
            }
            catch
            {
                Value.Set(Input[0]);
            }
        }

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Reply With Quote
 
  #17 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


NJAMC View Post
Okay @Fat Tails,

What kind of black magic is this? How does [-3] even exist, and how does the RSI use this to forecast 3 bars ahead!?!?!?

 
Code
        protected override void OnBarUpdate()
        {
            try
            {    
                Value.Set(Input[-3]);
            }
            catch
            {
                Value.Set(Input[0]);
            }
        }

That is the reason that I said that it is the dirtiest piece of code ever. I just published it, because I wanted to let you all test the master piece, as I do not know myself what will be happening.

Please report any incidents.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #18 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,220 since Jun 2009
Thanks: 628 given, 6,318 received
Forum Reputation: Legendary


Fat Tails View Post
That is the reason that I said that it is the dirtiest piece of code ever. I just published it, because I wanted to let you all test the master piece, as I do not know myself what will be happening.

Please report any incidents.

I just had one!

Reply With Quote
The following user says Thank You to cory for this post:
 
  #19 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: Ensign, Multicharts
Favorite Futures: SP500
 
Posts: 95 since Nov 2009
Thanks: 66 given, 56 received

You can easily extend a moving average with overriding the Plot() method.
There are some examples and indicators build with it from NT.

Another method

https://futures.io/ninjatrader/16683-future-plot-ninjatrader.html#post181458

Reply With Quote
The following 4 users say Thank You to ehlaban for this post:
 
  #20 (permalink)
Elite Member
Houston,Tx
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,293 received



ehlaban View Post
You can easily extend a moving average with overriding the Plot() method.
There are some examples and indicators build with it from NT.

Another method

https://futures.io/ninjatrader/16683-future-plot-ninjatrader.html#post181458


ehlaban View Post
I intend to make an upgrade without the plotting so you can use it as an add in, like you did,
to plot into the future with other indicators.

@ehlaban

Are you still working on this?

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
The following user says Thank You to ThatManFromTexas for this post:

Reply



futures io > > > > Projecting a Moving Average

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Moving Average sharmas Elite Automated Trading 62 April 9th, 2012 07:44 PM
Moving Average x distance away flight302 NinjaTrader Programming 2 March 26th, 2012 03:23 PM
Moving Average Kush NinjaTrader Programming 5 November 6th, 2011 01:49 PM
Moving average Help yiman NinjaTrader Programming 4 July 29th, 2011 09:03 AM
New Moving Average arnaudlx The Elite Circle 10 January 28th, 2011 06:15 AM


All times are GMT -4. The time now is 02:39 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-17 in 0.15 seconds with 40 queries on phoenix via your IP 54.82.56.95