![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Apr 2009
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
|
Hi. A fellow TTM member posted this code in the forum: it takes RSI values from 4 different time frames, and plots colored dots (4 rows of them) on the same chart. Can anybody please tell me how I could do this on Ninja? Any help is REALLY REALLY appreciated, thank you.
Inputs: UpperRSILevel(55), LowerRSILevel(45); Variables: RSI1(0), RSI2(0), RSI3(0), RSI4(0); RSI1 = RSI(Close of Data1, 14); RSI2 = RSI(Close of Data2, 14); RSI3 = RSI(Close of Data3, 14); RSI4 = RSI(Close of Data4, 14); Plot1(4, "RSI1", yellow); Plot2(3, "RSI2", yellow); Plot3(2, "RSI3", yellow); Plot4(1, "RSI4", yellow); If RSI1 > UpperRSILevel then Plot1(4, "RSI1", cyan); If RSI1 < LowerRSILevel then Plot1(4, "RSI1", red); If RSI2 > UpperRSILevel then Plot2(3, "RSI2", cyan); If RSI2 < LowerRSILevel then Plot2(3, "RSI2", red); If RSI3 > UpperRSILevel then Plot3(2, "RSI3", cyan); If RSI3 < LowerRSILevel then Plot3(2, "RSI3", red); If RSI4 > UpperRSILevel then Plot4(1, "RSI4", cyan); If RSI4 < LowerRSILevel then Plot4(1, "RSI4", red); |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
donatella,
I suggest you start with the tutorials on how to make your own custom indicator here: http://www.ninjatrader-support.com/H...tml?Overview23
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2008
Posts: 183
Thanks: 0
Thanked 1 time in 1 post
|
Donatella
That's a nice bit of code from the Forum. It can be easy adjusted to look at other indicators as well. I cannot translate it for you into C# but if you look at the indicator file sharing section, there is an indicator there that gives you coloured dashes based on different time frames, which may give you a clue. IMHO to use Ninja and to get the most out of it you have to learn at least some C#. However since Ninja is based on C# you can extend its features almost endlessly. If you are completely new to C# I would certaintly recommend you have a look at the MSDN beginner training videos. For the moderators - It would be nice in an example such as this to be able to point the prospective customer/subscriber to a few hours of basic Ninja programming videos. I know you do excellent online seminars but there is really not much on Ninjascript programming. |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Apr 2009
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
|
thanks, microal, i was actually able to write a strategy based on that code. i need to adjust a few things, i'm trying to figure out how to tell it that i don't want to reverse my position, but only enter if i'm flat. i never got to the point of actually plotting the colored rows, but i'll take a look at your suggestion, thanks so much
|
|
|
|
|
|
#5 |
|
Member
Join Date: Apr 2007
Location: , ,
Posts: 89
Thanks: 0
Thanked 0 times in 0 posts
|
donatella, that easylanguage code is looking at different datastreams of data - usually its different timeframes such as 1 minute and 3 minutes and 5 minutes. I didn't think multiple simultaneous timeframes are available in NT.
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
donatella, you can work with Position.MarketPosition to check if you're flat - http://www.ninjatrader-support.com/H...tPosition.html
This kind of MultiTime code is supported in a MultiTime strategy - http://www.ninjatrader-support.com/H...struments.html For indicators this will be possible with NinjaTrader 7 since it will add MultiSeries charting features.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Apr 2009
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
|
that's it, bertrand, thank you, now it's making sense
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Translate Amibroker Code to Ningatrader | kjw4255 | General Programming | 1 | 05-14-2008 10:16 AM |
| Can somebody translate this Laguerre indicator to NT??? | VagyokC4 | Indicator Development | 3 | 03-23-2008 11:20 AM |
| How does NT translate contract specifications? | arbifox | Automated Trading | 4 | 12-16-2007 09:06 PM |
| Can someone please translate this TS indicator code to NT | Razor_Trader | Indicator Development | 2 | 11-21-2007 06:48 PM |
| Using DLL Interface in TS Easy Language Strategy | robninja | Automated Trading | 1 | 06-03-2007 11:22 AM |