Announcement

Collapse
No announcement yet.

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 kinfxhk, 07-14-2026, 09:39 AM
        0 responses
        127 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        105 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        85 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        105 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        86 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X