Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Detailed about Value

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

    Detailed about Value

    I'd decided saw what is the connection between indicator SMA and stratege SampleMACrossOver Call Value.Set(Input[0]) it is as method from C#( get, set,,, ) ?
    If I think correctly, if in the indicator SMA executed command-line:
    Code:
    Value.Set(Input[0]);
    , therefore in the strategy for the perpose of SampleMACrossOver, must be same line's like:
    Code:
    Value.Get(Input[0])
    But nothing of the king in the strategy B]SampleMACrossOver[/B] don't using. Why?

    #2
    Hello,

    This would not be the correct syntax to get a value of an SMA in a strategy.

    Value is a Indicator only term, this represents the plot at index 0.

    NinjaTrader uses a Indexing system so you can refer to BarsAgo in the series of data you are referring to, the platform also uses a lot of collections so you will use the following items quite often.

    To get the SMA's value from a strategy, you would instead use SMA(14)[0]

    A strategy needs to make a call to the indicator by calling its name or:
    SMA

    This is followed by overload parameters or:
    SMA(IDataSeries, Period)

    This would be the Indicator, to get the value we need to choose an index from this collection series or a BarsAgo.
    SMA(IDataSeries, Period)[BarsAgo]

    The indicator sets the Plot at index 0 by using the term Value.Set() and stores its value for each bar to create the series which you accesses a value at a number of bars ago.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

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