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 sjsj2732, Yesterday, 04:31 AM
    0 responses
    36 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    287 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    288 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    134 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    95 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X