Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Function the returns/accepts a data series for NT8, syntax help.

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

    Function the returns/accepts a data series for NT8, syntax help.

    I'm stuck on a bit of syntax from an older NT7 indicator.

    An older function from NT7 was defined as:
    Code:
    public [COLOR=#e74c3c]IDataSeries[/COLOR] KVOLfunc([COLOR=#e74c3c]IDataSeries [/COLOR]TPYDAY,[COLOR=#e74c3c]IDataSeries [/COLOR]TPTOYDAY,int fastX,int trigLen,int slowX)
    {
    
    SVOL.Set(TPTOYDAY[0]>=TPTOYDAY[0] ? +Volume[0] : -Volume[0]);
    KVOL.Set(EMA(SVOL,fastX)[0]-EMA(SVOL,slowX)[0]);
    return KVOL;
    }
    To convert this to NT8, I am aware the set() method no longer works and has to be defined explicitly with assignment...

    But my question is about the highlighted sections above. How do you describe these data series for this function? I was trying to find syntax help HERE, but I have not been able to work it out.

    #2
    Originally posted by soon123
    For
    Code:
    public IDataSeries KVOLfunc (....)
    No need ,IDataSeries.
    If you are return a double value why have to do so.
    You can put it as double type function.
    Thank you sir!

    That was it. I'm needing to modify an already declared dataseries with that function, I just didn't understand the syntax. What wound up compiling was:
    Code:
    public ISeries<double> KVOLfunc(ISeries<double> TPYDAY, ISeries<double> TPTOYDAY,int fastX,int trigLen,int slowX)
    {
            SVOL[0] = (TPTOYDAY[0]>=TPTOYDAY[0] ? +Volume[0] : -Volume[0]);
            KVOL[0] = (EMA(SVOL,fastX)[0]-EMA(SVOL,slowX)[0]);
            return KVOL;
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 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
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X