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!
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
NinjaTrader
Moving Average that resets every day
Collapse
X
-
Hello Brcln9301,
Thanks for your post and welcome to the NinjaTrader forums.
If you haven't already you may want to look through the file sharing section to see if there is anything that will meet your needs or for future reference: http://www.ninjatrader.com/support/f...1&pp=15&page=2
I am not aware of an indicator that starts at 0 on each trading day however if you are interested in creating one in Ninjascript I would be glad to get you started.
Please let me know if I can be of further assistance.Paul H.NinjaTrader Customer Service
-
Originally posted by Brcln9301 View PostHello is there moving average indicator, which calculation begins from every new day start?
One of the problems you'll face is that if, for example, you were to do this and you were using a 14 Period Simple Moving Average*, then your average wouldn't be fully precise until 14 bars have been printed, and that could be a time when you'd like to do some trading.
Another idea (and I think there's something proprietary which does this) is to adjust yesterday's close to the same level as today's open. This shouldn't be too difficult to do in code but would maybe be a job for more advanced coders.
Best of luck with your trading!
* Remember: there are many different moving averages to choose from.Last edited by arbuthnot; 01-13-2015, 03:58 PM.
Comment
-
The concept really depends on the moving average that you wish to select.
For example for a SMA(n), I would prefer a version that
- calculates a SMA(1) for the opening bar
- calculates a SMA(2) for the next bar
.....
- calculates a SMA(n) for the nth bar
- then continues to calculate a SMA(n)
This version would be better than a gapless SMA, as the gapless SMA suffers from the impact of bars dropping out from the prior trading day.
However, for an EMA(n), I would eventually prefer a gapless EMA. The EMA does not suffer from dropouts, and the fact using a gapless EMA attaches it to the opening price of the first bar of the session. This gets you a less nervous indicator for the first n bars.
Both types of indicator can be easily coded, but need to take into account session breaks.
Comment
-
For example for a SMA(n), I would prefer a version that
- calculates a SMA(1) for the opening bar
- calculates a SMA(2) for the next bar
.....
- calculates a SMA(n) for the nth bar
- then continues to calculate a SMA(n)
I remember that, years ago, I did actually try the precise idea you describe as quoted. (In Excel, not Ninja, though.) However, let's say your normal SMA parameter is 14, the quality of of the SMA until you get to or near the 14th bar will be seriously inadequate and so probably unusable for the first 10 bars, say.
Very good ideas, Harry, about a gapless EMA. Cheers.Last edited by arbuthnot; 01-15-2015, 07:40 AM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by r68cervera, Today, 05:29 AM
|
0 responses
2 views
0 likes
|
Last Post
by r68cervera
Today, 05:29 AM
|
||
Started by geddyisodin, Today, 05:20 AM
|
0 responses
3 views
0 likes
|
Last Post
by geddyisodin
Today, 05:20 AM
|
||
Started by JonesJoker, 04-22-2024, 12:23 PM
|
6 responses
35 views
0 likes
|
Last Post
by JonesJoker
Today, 05:14 AM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
12 responses
3,239 views
0 likes
|
Last Post
by Leafcutter
Today, 05:08 AM
|
||
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
0 responses
6 views
0 likes
|
Last Post
by AveryFlynn
Today, 04:57 AM
|
Comment