i will have a play
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
ATR - calculate the ATR ticks for the last 7 days
Collapse
X
-
This is good yes i can see how that works ok. It may be better to extract and ecapsulate my signal logic into an indicator and then read it in the strategy - generic code maybe re used than for that gem...Originally posted by NinjaTrader_Austin View PostTom, I wasn't sure of your programming skills, so I didn't suggest anything too complicated from the start.
You can try this: run your ATR calculations from a daily chart, and then have your strategy communicate with that daily chart to retrieve the values. Here is a reference sample that demonstrates how to expose indicator values. The sample includes a strategy and an indicator--they work together and are a great example.
For now however the my strategy times series is 89ticks - no decision making is made on the week chart period - only an indication of the typical oppurtunity of an instrument.
E.G ES 18 points ATR for the last 7 days...
arget 1 = 8% of daily ATR --- eg 8% of 21points
13% for target 2 and so on... -
I need to do this on any periodtype - the chart period will be 15 days.
The only constant variable (if that is possible) is the ATR ticks is represented by last 7 days...
Leave a comment:
-
BarsRequired = 20;
It can also be set via the UI when you add a strategy.
Leave a comment:
-
the default of 20 - can i change that programmatically? is that set when the strategy is added to a chart?Originally posted by NinjaTrader_Josh View Posttomlesson,
NT for sure does allow you to mix intraday with weekly. You just need to ensure you reach the min. bars required requirement on all bar series. By default this means you need 20 bars which would be a lot of time to achieve 20 weekly bars.
Leave a comment:
-
I am checking this out.Originally posted by NinjaTrader_Austin View PostTom, I wasn't sure of your programming skills, so I didn't suggest anything too complicated from the start.
You can try this: run your ATR calculations from a daily chart, and then have your strategy communicate with that daily chart to retrieve the values. Here is a reference sample that demonstrates how to expose indicator values. The sample includes a strategy and an indicator--they work together and are a great example.
thank you!
Leave a comment:
-
yes i think i can see how that would work :-)Originally posted by NinjaTrader_Josh View Posttomlesson,
NT for sure does allow you to mix intraday with weekly. You just need to ensure you reach the min. bars required requirement on all bar series. By default this means you need 20 bars which would be a lot of time to achieve 20 weekly bars.
Leave a comment:
-
Tom, I wasn't sure of your programming skills, so I didn't suggest anything too complicated from the start.
You can try this: run your ATR calculations from a daily chart, and then have your strategy communicate with that daily chart to retrieve the values. Here is a reference sample that demonstrates how to expose indicator values. The sample includes a strategy and an indicator--they work together and are a great example.
Leave a comment:
-
tomlesson,
NT for sure does allow you to mix intraday with weekly. You just need to ensure you reach the min. bars required requirement on all bar series. By default this means you need 20 bars which would be a lot of time to achieve 20 weekly bars.
Leave a comment:
-
Thanks for your replies:
The smaller time has to be the primary.
The system has been tested with a weekly atr average value.
NT strategy wotn allow me to mix intrady series with weekly series - so i guess i will have to count evrery bar and take an average for each 7 day period.. or create it on another chart and then commuicate this to the running strategy module..:-) through a common static class, a data cache, or maybe even post via a windowsmessage...:-)
Leave a comment:
-
Not sure what the * 100 and the *0.25 mean... If I remember my basic math properties, multiplication is associative so (ATR(14) * 0.25) * 100 = ATR(14) * 25.Originally posted by tomleeson View Post
somevalue= (ATR(14)[1] * 0.25) * 100);
i believe the * 100 is there to convert it to to a number versus degrees?
what is the 0.25 (ticks?)
In addition, there is a helpful function in NinjaTrader that rounds a value to the nearest tick size. Here is the reference page for Round2TickSize.
Leave a comment:
-
Tom, what you outlined in your first post would work, but the larger timeframe must be the primary instrument.
Leave a comment:
-
i found this:
http://www.ninjatrader-support2.com/...e+Range&page=2
somevalue= (ATR(14)[1] * 0.25) * 100);
i believe the * 100 is there to convert it to to a number versus degrees?
what is the 0.25 (ticks?)
Leave a comment:
-
essentially i wish to get the number of ticks an instrument moves per day - using the last 7 days as the period - but calculate it from a intraday period (so it can achieved in a intrady stratefy)...
Eg.
last 7 day ES was 20 points per day or 80 ticks
i can use the 80 ticks as the basic tradeable oppurtunity.
i thought ATR migh assist in this - maybe i need to look at another patternLast edited by tomleeson; 07-21-2009, 03:20 PM.
Leave a comment:
-
Not sure what you mean "tick value". ATR will come out as some range value as determined by the high - low calculation for the various days.
Leave a comment:
-
I have had a look at quite a few and inspected the code -and drew a blank - as they are mostly indicators and the such like - all i want is a pattern/ method to obtain the ATR for the last 7 days... as a tick value.
I will keep looking
Leave a comment:
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
476 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
317 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
254 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
340 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
306 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Leave a comment: