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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X