NexusFi: Find Your Edge


Home Menu

 





Projecting a Moving Average


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 10 posts (26 thanks)
    2. looks_two vegasfoster with 6 posts (2 thanks)
    3. looks_3 ThatManFromTexas with 4 posts (1 thanks)
    4. looks_4 WolfieWolf with 3 posts (0 thanks)
      Best Posters
    1. looks_one ehlaban with 4 thanks per post
    2. looks_two Fat Tails with 2.6 thanks per post
    3. looks_3 cusp with 2 thanks per post
    4. looks_4 vegasfoster with 0.3 thanks per post
    1. trending_up 13,539 views
    2. thumb_up 36 thanks given
    3. group 11 followers
    1. forum 30 posts
    2. attach_file 6 attachments




 
Search this Thread

Projecting a Moving Average

  #1 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

Hi,

What would the logic be to create a dataseries where the close of the current bar is estimated as the current price and the close of the next bar is estimated as the current price for purposes of projecting a moving average one bar forward?

For example, if selecting a moving average period of 4, the dataseries would be represented by close[2], close[1], close[0], close[0].

Or if you can refer me to an indicator where this has been done that would also help. It seems like it should be simple, but I can't wrap my head around this. I found this for MC, which seems like what I am trying to do, but it's not helping me do it in c



Thanks for any help.

Started this thread Reply With Quote
The following user says Thank You to vegasfoster for this post:

Can you help answer these questions
from other members on NexusFi?
Request for MACD with option to use different MAs for fa …
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
50 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
What percentage per day is possible? [Poll]
31 thanks
GFIs1 1 DAX trade per day journal
31 thanks

  #2 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,348

I thought Ninja Trader couldn't project a plot in the future .....

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
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



ThatManFromTexas View Post
I thought Ninja Trader couldn't project a plot in the future .....

You are thinking too much. Just do it!



Hint: You can select the displacement feature with any indicator. You can also use the Draw() methods and use negative values for barsAgo.

Below is a chart with a displaced MACD overlayed on the price bars.


Reply With Quote
The following 3 users say Thank You to Fat Tails for this post:
  #4 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,348


Fat Tails View Post
You are thinking too much. Just do it!



Hint: You can select the displacement feature with any indicator. You can also use the Draw() methods and use negative values for barsAgo.

Below is a chart with a displaced MACD overlayed on the price bars.


@Fat Tails

But if you displace an indicator [-1] , aren't you just shifting the whole thing forward as opposed to
drawing a plot one bar ahead of price?

And just so you know.... no one has ever accused me of thinking....

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
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


ThatManFromTexas View Post
@ Fat Tails

But if you displace an indicator [-1] , aren't you just shifting the whole thing forward as opposed to
drawing a plot one bar ahead of price?

That is the same. Shifting the plot allows you to calculate future indicator values from current input values. If you wish to calculate futures indicator values without without using current input values, you can always use one of the Draw() methods to fill that empty space on the right side of the current bar....

Reply With Quote
The following user says Thank You to Fat Tails for this post:
  #6 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,348


Fat Tails View Post
That is the same. Shifting the plot allows you to calculate future indicator values from current input values. If you wish to calculate futures indicator values without without using current input values, you can always use one of the Draw() methods to fill that empty space on the right side of the current bar....

@Fat Tails

Can an indicator calculate a future co-ordinate value and plot it?


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
  #7 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


ThatManFromTexas View Post
@ Fat Tails

Can an indicator calculate a future co-ordinate value and plot it?


Yes, provided you make up your mind, which algorithm you want to use for forecasting the indicator values.

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
  #8 (permalink)
cusp
Bundeburg
 
Posts: 48 since Mar 2012
Thanks Given: 27
Thanks Received: 49

The simplest projection of the next ma value would probably be

ma[i+1] = ma[i] + ( ma[i]-ma[i-1] )

You could get a lot more complicated but are probably not going to be any more accurate.

You can project future values with Sierra Chart.

Reply With Quote
  #9 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


cusp View Post
The simplest projection of the next ma value would probably be

ma[i+1] = ma[i] + ( ma[i]-ma[i-1] )

You could get a lot more complicated but are probably not going to be any more accurate.

You can project future values with Sierra Chart.

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.


Attached Files
Elite Membership required to download: LinearForecast.zip
Reply With Quote
The following 7 users say Thank You to Fat Tails for this post:
  #10 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,970 since Dec 2010
Thanks Given: 3,037
Thanks Received: 2,394



Fat Tails View Post
Yes, provided you make up your mind, which algorithm you want to use for forecasting the indicator values.

@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?

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote





Last Updated on May 13, 2013


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts