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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    35 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    12 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X