Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Understanding IdataSeries .

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

    Understanding IdataSeries .

    I am trying to use the foollowing condition:
    if (CrossBelow(Highs[1][0], SMA (BarsArray[1],SMACycle)[0],1))

    compiler shows me this error;
    argument 2 cannot convert from double to NT idataseries?

    How to fix it and what does this error means?

    #2
    Hi dafonseca,

    Highs[1][0] has a bars ago value '[0]' which means this will return a double that is the value of the SMA on the current bar. The same is true of SMA(BarsArray[1],SMACycle)[0].

    This means that you are trying to detect when a double value (which does not change) crosses another double value (which also will not change). In other words there is no data series to detect a cross on as a cross detection looks to see if the first value from a bar ago is less than the second value a bar ago and then the first value from the current bar is greater than the second value from the current bar.

    The crossabove/crossbelow needs at least one dataseries but I think you want two dataseries.

    Try instead:
    Code:
    if (CrossBelow(Highs[1], SMA(BarsArray[1],SMACycle),1))
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X