[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries MyOutput
{
get {
[COLOR=Red]if ( ???) [/COLOR]Update();
return myOutput;
}
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Best Practice for Referencing an Indicator on bar close in a Real Time Strategy?
Collapse
X
-
As I explained below, the provided code example doesn't return any output in real time without the Update() method in the getter of the output series of the called indicator. And I want to make sure that the called indicator isn't called more than once on FirstTickOfBar. Is there a way to check if an indicator is updated or not on the current bar so that one could enter a conditional statment for Update(); in the getter of the called indicator?
Code:
-
Thanks! The "if ( !myOutput().ContainsValue(x)) Update();" did the trick. It seems as if the check with "myOutput().ContainsValue(x)" in itself is sufficient to make the called indicator update on FirstTickOfBar. The Update() method was never called during my tests in Market Replay.
Regarding the Update() method, what does it actually update? Is it just the OnBarUpdate() method of the called script that is executed, or does Update() execute an entire OnBarUpdate() of a "compiled assembly" of the strategy and all its referenced indicators?
/Best Regards
Poseidon_STHLM
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
601 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
559 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment