Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Moving Average of Rsi - error

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

    Moving Average of Rsi - error

    I am trying to create my first indicator,
    an "Exponential Moving Average of RSI".

    Two errors appear saying that:

    1) The best overloaded method match for 'NinjaTrader.Indicator.Indicator.EMA(NinjaTrader.D ata.IDataSeries, int)' has some invalid arguments

    2) Argument '1': cannot convert from 'double' to 'NinjaTrader.Data.IDataSeries'



    It must me something simple. What am I doing wrong ???

    double myrsi = RSI(14,3)[0];
    double average = EMA(myrsi,45)[0];
    Myplot0.Set(average);



    Thanx in advance.
    Sorry if it is a silly question, I am used to Metastock Language and I am trying to understand how it works with Ninjascript.



    #2
    Your myrsi should be DataSeries.
    Try:
    //In Variables section:
    private DataSeries myrsi;

    // In Initialize section:

    myrsi = new DataSeries (this);

    // In OnBarUpdate Section:

    myrsi.Set(RSI(14,3)[0]);
    Myplot0.Set(EMA(myrsi, 45)[0]);

    Hope it helps...

    Originally posted by Andy Korbi View Post
    I am trying to create my first indicator,
    an "Exponential Moving Average of RSI".

    It must me something simple. What am I doing wrong ???

    double myrsi = RSI(14,3)[0];
    double average = EMA(myrsi,45)[0];
    Myplot0.Set(average);



    Thanx in advance.
    Sorry if it is a silly question, I am used to Metastock Language and I am trying to understand how it works with Ninjascript.

    Last edited by roonius; 01-08-2009, 08:35 PM.

    Comment


      #3
      More information on DataSeries - http://www.ninjatrader-support.com/H...iesObject.html
      RayNinjaTrader Customer Service

      Comment


        #4
        Thank you very much roonie, I followed your advice
        and finaly I made it work right.

        And thanx Ray for your answer and for being always present....


        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        3 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Working...
        X