I am plotting an MA of ATR in a sub-window, but the canned ATR can only do i think the SMA of an MA. I want to make the MA exponential. Any help on how to code that, should be fairly simple, but I'm pretty new. Thanks!
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
ATR(MA) Progamming
Collapse
X
-
Originally posted by NinjaTrader_Matthew View PostThe ATR itself is an exponential average... meaning the actual smoothing period used for the ATR will be calculated exponentially.
Do you perhaps have an external reference we can look at to compare what you're trying to accomplish?
Also, from what I understand of ATR, if you do ATR(5), is returns the average true range for the last 5 days. Which should just be a simple average. Just looking to make the average exponential. In Tradestation it also lets you customized the MA of the ATR. Thanks for all your help!
Comment
-
In additional to koganam's question, do you perhaps have a screen shot of your Ensign chart/template?
If possible, please include a daily period of any of your favorite instruments, and I'll be happy to help determine if this is something we can accommodate.MatthewNinjaTrader Product Management
Comment
-
The average true range was developed by Welles Wilder. The formula uses a variation of the exponential moving average known as Wilder's average. While a modern EMA uses a smoothing constant of 2/(n+1), Wilder used a smoothing constant of 1/n, where n is the lookback period of the indicator.
NinjaTrader uses Wilder's original formula and neither a simple moving average nor a standard exponential moving average.
According to the documentation Ensign uses an exponential moving average of the true range. It is unclear, whether they use the smoothing constant 2/(n+1) or 1/n to calculate the ATR.
Technically it is possible to calculate an average true range or simple range by using any type of moving average.
If you want to transfer your template from Ensign to NinjaTrader, you would need to show us
-> a daily chart of one of the DJIA stocks with the ATR applied
-> the indicator code of the ATR, so we can check how it is calculatedLast edited by Harry; 01-07-2014, 06:48 PM.
Comment
-
Thanks for all the reply's and help.
I uploaded a chart and then just the setting for ATR in Ensign (Ensign does not provide the source code, just asked). While I plot the ATR(100) at the bottom, I close that and you can see in the upper left, I have the ATR there (I use ATR for profit/loss targets is all, not as an indicator). And it all may be a moot point because the ATR readings are slightly off, but I have been using them in my trading for 4 years, so would really like to recreate it exactly in NT.
Also, as you can see in the chart, I use what looks like zigzag but it's pesavento patterns. I have been able to recreate it with zigzag in NT, but would need some customization on a few tweaks. Recommendations on someone I could hire or help? Would be a minor project.
Comment
-
Originally posted by Stok View PostThanks for all the reply's and help.
I uploaded a chart and then just the setting for ATR in Ensign (Ensign does not provide the source code, just asked). While I plot the ATR(100) at the bottom, I close that and you can see in the upper left, I have the ATR there (I use ATR for profit/loss targets is all, not as an indicator). And it all may be a moot point because the ATR readings are slightly off, but I have been using them in my trading for 4 years, so would really like to recreate it exactly in NT.
Also, as you can see in the chart, I use what looks like zigzag but it's pesavento patterns. I have been able to recreate it with zigzag in NT, but would need some customization on a few tweaks. Recommendations on someone I could hire or help? Would be a minor project.
And if possible, do NOT use a FOREX chart. FOREX data comes from different electronic networks, and the FOREX feed that you used for Ensign will likely not match the FOREX feed that we can use to check your chart. Even worse, daily FOREX bars depend on the cutoff time. Some FOREX providers use 5:00 PM EST, others use midnight GMT.
Please show us a daily chart - or a 60 min chart - from a centralized exchange aloowing us to apply the ATR to the same data as you did. And make sure that you have added the ATR indicator to your chart.
We cannot help you, if you do not provide the necessary information.
Comment
-
Originally posted by Harry View PostWe cannot check the ATR, if you don't display it on your chart. Just one value in the upper left corner is not enough, but it is necessary to plot the ATR over the entire chart in a separate indicator panel.
And if possible, do NOT use a FOREX chart. FOREX data comes from different electronic networks, and the FOREX feed that you used for Ensign will likely not match the FOREX feed that we can use to check your chart. Even worse, daily FOREX bars depend on the cutoff time. Some FOREX providers use 5:00 PM EST, others use midnight GMT.
Please show us a daily chart - or a 60 min chart - from a centralized exchange aloowing us to apply the ATR to the same data as you did. And make sure that you have added the ATR indicator to your chart.
We cannot help you, if you do not provide the necessary information.
Comment
-
Originally posted by Stok View PostI attached a chart and plotted the ATR at the bottom. Since it is a 100EMA, it will be smooth like that. If I plot it in a sub-window, it hardly shows.
The ATR does not show any values on the chart, so it cannot be compared to anything. We do not need a period of 100 to compare, why can't we start with a simple case
-> a daily chart of a stock or a futures contract with the ATR(14) added on a separate channel, maybe with a data box attached, so that we can see the price values and indicator values for the current day
-> 60 min chart with the ATR(14) added on a separate panel
With your chart nothing can be compared! It is important to see the indicator shape, that is highs and lows and the indicator values! No need to add any other indicators, just a virgin chart and the ATR(14)!
Comment
-
Originally posted by Harry View PostWe cannot check the ATR, if you don't display it on your chart. Just one value in the upper left corner is not enough, but it is necessary to plot the ATR over the entire chart in a separate indicator panel.
And if possible, do NOT use a FOREX chart. FOREX data comes from different electronic networks, and the FOREX feed that you used for Ensign will likely not match the FOREX feed that we can use to check your chart. Even worse, daily FOREX bars depend on the cutoff time. Some FOREX providers use 5:00 PM EST, others use midnight GMT.
Please show us a daily chart - or a 60 min chart - from a centralized exchange aloowing us to apply the ATR to the same data as you did. And make sure that you have added the ATR indicator to your chart.
We cannot help you, if you do not provide the necessary information.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PaulMohn, Today, 05:00 AM
|
0 responses
6 views
0 likes
|
Last Post
by PaulMohn
Today, 05:00 AM
|
||
Started by ZenCortexAuCost, Today, 04:24 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 04:24 AM | ||
Started by ZenCortexAuCost, Today, 04:22 AM
|
0 responses
2 views
0 likes
|
Last Post Today, 04:22 AM | ||
Started by SantoshXX, Today, 03:09 AM
|
0 responses
16 views
0 likes
|
Last Post
by SantoshXX
Today, 03:09 AM
|
||
Started by DanielTynera, Today, 01:14 AM
|
0 responses
3 views
0 likes
|
Last Post
by DanielTynera
Today, 01:14 AM
|
Comment