Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Update() to pull DataSeries from Indicator

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

    Using Update() to pull DataSeries from Indicator

    Hello,

    I've seen the BoolSeries sample indicator and strategy. My indicator DataSeries has the Update(); in properties as follows:

    Code:
    [Browsable(false)]		[XmlIgnore()]	public DataSeries Signal
    	{	get { Update();return _signal; }	}
    My Plot I'm tracking for this example is the current value of Values[7].
    Since Update() cannot be used in strategies, I'm trying to find the best method for getting current values.
    I want to "reacquire" the current value of the Plot or DataSeries from the indicator to reassign values in the Strategy.

    ie,
    Code:
    if (_myIndi.Signal.ContainsValue(0) && 
    Signal[0] == 1 &&
    _myIndi.Values[7].ContainsValue(0))
    {
    	limitOrderPrice = _myIndi.Values[7][0] + 0*TickSize;
    What line(s) of code do I need to add / modify to ensure the current indicator value can be adjusted in the strat every time there's a new bar or new tick update? I'm using COBC = false.

    Thanks,
    Kirk
    Last edited by zeller4; 12-13-2011, 09:09 AM.

    #2
    Hi Kirk,

    Update() is not required for any *Series values. These classes hold internal logic that ensure that the OnBarUpdate() method of the indicator is processed prior to accessing the current bar’s value. This guarantees you will receive up-to-date values when retrieving the calculations.

    You may want to follow the model in that sample though, where the private variable is used within the indicator code, and this is linked to a public variable that you could access from other scripts.
    Last edited by NinjaTrader_RyanM1; 12-13-2011, 04:00 PM.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    668 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    377 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    580 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X