Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New and Fun error code

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

    New and Fun error code

    // plot below by replacing 'Close[0]' with your own formula.
    myDataSeries.Set(((High[0] - Low[0])/2) + Low[0]);
    myDataSeries1.Set((High[
    0] - Low[0]) + High[0]);
    myDataSeries2.Set(Low[
    0] - (High[0] - Low[0]));
    Plot0.Set(SMA(myDataSeries[
    0], myInput0));
    Plot1.Set(Close[
    0]);
    Plot2.Set(Close[
    0]);

    What is the problem with this? This is the error code I'm getting.
    The best overloaded method match for 'NinjaTrader.Indicator.SMA(NinjaTrader.Data.IDataS eries, Int) has some invalid arguments, specifically Argument 1 cannot covert form Double to IDataseries. What is double? What does that mean? How is it used? The online manual is, at best, vague.

    #2
    Hi bobby1001,

    This line
    Code:
    [FONT=Courier New][SIZE=2]Plot0.Set(SMA(myDataSeries[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]], myInput0));[/SIZE][/FONT]
    should be
    Code:
    [FONT=Courier New][SIZE=2]Plot0.Set(SMA(myDataSeries[/SIZE][/FONT][FONT=Courier New][SIZE=2], myInput0)[COLOR=SeaGreen][0][/COLOR]);[/SIZE][/FONT]
    A double is basically a number with decimal points. The first parameter when you call SMA() is suppose to be a DataSeries object not a double object. To get the DataSeries object you can remove the [0] indexing. In this case, you will also need to add an index reference at the end of SMA(). Make sure myInput0 is an int and it should compile after that.
    Last edited by NinjaTrader_JoshP; 10-02-2007, 09:04 PM.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thank you

      It worked fine. I think I understand why, but wanted to check to make sure. The [0] we added refers to the SMA for the plot, correct?

      Thanks again.

      Comment


        #4
        Correct. It refers the latest SMA() value to the plot.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        368 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        571 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X