NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-11-2008, 07:33 AM   #1
chartlearner
Member
 
Join Date: Apr 2008
Posts: 64
Thanks: 0
Thanked 0 times in 0 posts
Default Help converting EL to Ninja

Hi, I have a Trix indicator that I modified in easy language and need help converting to ninjascript. Thanks in advance, Tom






[LegacyColorValue = false];
{ 2-Line TRIX indicator for Jongseon Kim's TAOSC article
"When and When Not To Trade", TAOSC - Jan. 2004 }
inputs:
SigLineXMALen1( 3) ,
TRIXLength( 3.75) ,
SigLineXMALen2( 4.5) ;

variables:
EMA1( 0 ),
EMA2( 0 ),
EMA3( 0 ),
TRIXLine( 0 ),
SignalLine1( 0 ),
SignalLine2( 0 ) ;

EMA1 = XAverage( Close, TRIXLength ) ;
EMA2 = XAverage( EMA1, TRIXLength ) ;
EMA3 = XAverage( EMA2, TRIXLength ) ;
if EMA3[1] <> 0 then

{ Ensure not about to divide by zero }
TRIXLine = 10 * ( EMA3 - EMA3[1] ) / EMA3[1] ;
SignalLine1 = XAverage( TRIXLine, SigLineXMALen1 ) ;
SignalLine2 = XAverage( TRIXLine, SigLineXMALen2 ) ;
Plot1( TRIXLine, "TRIXLine1" ) ;
Plot2( SignalLine1, "SignalLine1" ) ;
Plot3( SignalLine2, "SignalLine2" ) ;
Plot1( TRIXLine, "TRIXLine1" ) ;
if TRIXLine >= TRIXLine[1] then
SetPlotColor(1,rgb (0,127,255)){slateblue}
else
SetPlotcolor(1,rgb(255,36,0));
Plot2( SignalLine1, "SignalLine1" ) ;
if SignalLine1 >= SignalLine1[1] then
SetPlotColor(2,green)
else
SetPlotcolor(2,Magenta);

Plot3( SignalLine2, "SignalLine2" ) ;
if SignalLine2 >= 0 then
SetPlotcolor (3,DarkGreen)
else
SetPlotcolor (3,darkred);
chartlearner is offline  
Reply With Quote
Old 12-11-2008, 07:44 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Hi Tom,

We have a TRIX indicator already available in NinjaTrader - http://www.ninjatrader-support.com/H...ntialTRIX.html

Maybe you can use this as a starting point and code your custom changes in a new version - here are our indicator programming tutorials > http://www.ninjatrader-support.com/H...verview18.html
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-11-2008, 01:20 PM   #3
RJay
Senior Member
 
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 12
Thanked 24 times in 18 posts
Default

Chartlearner,

I already built this for someone else. ( minus your changes )

http://www.ninjatrader-support2.com/...ad.php?t=11487

Its already 90 percent done.

Just update the TRIX2.zip version to include the color changes.


RJay
RJay is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting TS emini data to Ninja Marshmellowhead Miscellaneous Support 5 12-21-2008 10:34 AM
Is there a NS equivalent to BigPointValue in EL? Elliott Wave General Programming 3 11-25-2008 08:13 PM
Converting easy language chartlearner General Programming 11 09-23-2008 11:39 AM
Methodology for converting mt4 to ninja blazer Miscellaneous Support 1 08-17-2008 08:46 AM
Handling Rejected Orders with TradeStation 8.3 EL strategy, using NT Rocket130713 Automated Trading 5 05-20-2008 07:15 AM


All times are GMT -6. The time now is 04:53 AM.