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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    59 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X