![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Mar 2008
Posts: 65
Thanks: 0
Thanked 0 times in 0 posts
|
The below example was taken from the Help Guide refering to a boolean.
protected override void OnBarUpdate() { if (BarsInProgress == 0) { if (CCI(20)[0] > 200 && CCI(BarsArray[1], 20)[0] > 200 && CCI(BarsArray[2], 20)[0] > 200) { // Do something } } } Also, all examples seen so far explains how to do a multiple time indicator with booleans, but what I'm looking is how to code a multiple time indicator with SMAs. Example: if SMA(5) CrossAbove SMA(10) from a 60 Min chart; //Do something... Also, Does NT 6.5 supports the following?: if SMA(5) CrossAbove SMA(10) from a 60 Min chart && CCI(BarsArray[2], 20)[0] > 200) //Do something... |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
There are no reference samples on multi-time framed indicators since it is currently not supported. All the multi-time frame features are currently for strategies.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 | ||
|
Member
Join Date: May 2007
Location: West Jordan, Utah
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
|
Perhaps I do not clearly understand your question, but here is an example of how to do what you are asking:
Quote:
Code:
Add(PeriodType.Minute,60); Quote:
I hope this helps. |
||
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Dec 2007
Posts: 7
Thanks: 0
Thanked 0 times in 0 posts
|
Yes you can do it with a strategy, though a little coarse.
I use DrawDot or Triangle or Diamond, once you do the Add( PeriodType.Minute, 60 ) or whatever you want in initialize. I haven't been able to get the DrawLine to work yet but haven't spent much time with it either. It would be nice if you could set a size for DrawDot... etc. They are too large in size now. Also doing a draw with a strategy sets a boundary for your chart. It must remain in viewing area of chart. It would be nice if it would be allowed to scroll off the screen, then you could shrink the axis if you wanted to see it. Sometimes another period indicator is far away from price and don't need to see it. In TradeStation you can set a flag to turn off Include All Indicators in view ( I understand that this is technically a strategy not an indicator, just using a strategy to act as surrogate indicator from anther time period ) |
|
|
|
|
|
#5 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
If you don't want your draw objects to influence your chart scale you will need to turn the AutoScale property on them off.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiple Instrument Indicator | Kunisoft | Indicator Development | 12 | 04-14-2010 09:06 AM |
| MRO in indicator with multiple plots | Jim-Boulder | General Programming | 2 | 01-10-2008 11:34 AM |
| Using multiple IB/TWS instances to maximize number of available real-time data | EvolveK | Automated Trading | 4 | 01-07-2008 07:47 AM |
| cursor updates time position on multiple chart windows | fragalles | Historical NinjaTrader 6.5 Beta Threads | 1 | 11-30-2007 02:29 AM |
| Multiple Time Frame access | stepwise | General Programming | 1 | 03-31-2007 03:33 AM |