Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Brevo, Today, 01:45 AM
    0 responses
    3 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    239 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    6 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Working...
    X