• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help converting EL to Ninja

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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);

    #2
    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
    BertrandNinjaTrader Customer Service

    Comment


      #3
      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
      NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Simon Investimens, Today, 03:26 AM
      0 responses
      3 views
      0 likes
      Last Post Simon Investimens  
      Started by EnveousColnago, Yesterday, 06:58 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by owreivmatot, Today, 01:38 AM
      0 responses
      1 view
      0 likes
      Last Post owreivmatot  
      Started by lindsayf, Today, 01:13 AM
      0 responses
      6 views
      0 likes
      Last Post lindsayf  
      Started by thgamey, Yesterday, 06:46 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Working...
      X