![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Apr 2010
Posts: 1,058
Thanks: 33
Thanked 2 times in 1 post
|
I want to display how far an instrument moved in the last bar, e.g. 60 min time frame.
I thought the easiest way to do this would be: Code:
Value.Set(Close[0] - Close[1]); I would like it to display how far it moved in the last 60 mins at any instant in time, not just the last 60 min bar on a chart i.e. 11:00 to 11:59. So I set CalculateOnBarClose to false. However this doesn't show the results I am expecting. I think this shows how far it moved since the close of the last bar. How should I achieve what I want? Shall I forget about trying to use 60 mins bars and use 10 second bars and just calculate the number of bars in a 60 min interval? Or is there a simpler way? Thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
adamus, correct this would show you how much the instrument moved since the Close[1].
What were you looking for? The Range of the bar instead? Perhaps the High[0] - Close[1] and Low[0] - Close[1] difference taken as absolute would do?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Apr 2010
Posts: 1,058
Thanks: 33
Thanked 2 times in 1 post
|
It's difficult to be totally unambiguous about what I want, but i'll try.
I want the column in Market Analyzer to show how far the instrument has moved in the last x time periods at any instant in time. i.e. if I choose 1 day, I want to see how far it has moved in the last 24 hours from now. if I choose 1 hour and it's 13:45, I want to see how far it's moved since 12:45. I initially thought it would be easiest to use the dataseries time frame to define what I want to see, but this isn't working the way I'm doing it - as you described. |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
adamus, I see what you're saying - then you would need to custom calculate your hour reaching back from current time on a finer series.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Apr 2010
Posts: 1,058
Thanks: 33
Thanked 2 times in 1 post
|
OK, I've done it like that. It works well, although I restricted the parameters to just the number of minutes, instead of allowing a choice of time frame units.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strategy.CalculateOnBarClose=true vs. Indicator.CalculateOnBarClose=false | karimatka | Strategy Development | 7 | 05-23-2011 03:39 AM |
| CalculateOnBarClose = false\true | nkonkov | Strategy Development | 3 | 06-17-2010 03:28 AM |
| CalculateOnBarClose = false; | Rhyshaelkan | Indicator Development | 1 | 11-19-2009 03:42 PM |
| DataSeries as Input for Indicator with CalculateOnBarClose = false | cbaer | Indicator Development | 1 | 01-14-2009 03:56 AM |
| what really happens when calculateonbarclose = false | verge | Strategy Development | 9 | 07-28-2008 01:50 AM |