- ago
Hi, many times HasStreamingBar does not detect that it's real-time. The following was run during trading hours. Note the text label in the screenshot.
The strange thing is that if I uncheck the stream button it will indicate that it's real-time.

CODE:
//create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          if (bars.HasStreamingBar){             DrawHeaderText("Real Time", WLColor.Azure, 15);          } else DrawHeaderText("Not real Time", WLColor.Azure, 15);       }
0
313
Solved
8 Replies

Reply

Bookmark

Sort
Glitch8
 ( 9.28% )
- ago
#1
HasStreamingBar is not intended to be used in a Strategy. It's used internally by our charting component.

0
Best Answer
Glitch8
 ( 9.28% )
- ago
#2
From our docs:

0
- ago
#3
Is there a better way to accomplish that?

0
Cone8
 ( 5.88% )
- ago
#4
What are you trying to accomplish?
0
- ago
#5
I am trying to update the last bar indicator based on the latest price.
I think I found the solution. Check Bars.Close.StreamingValue for NaN.
0
- ago
#6
Well, that's also unreliable :(
0
Glitch8
 ( 9.28% )
- ago
#7
It's just not feasible in a Strategy. A Strategy executes at one specific point in time. For backtesting purposes, what difference does it make what the current streaming price is?
0
Cone8
 ( 5.88% )
- ago
#8
You got it.
Here's how CalculatePartialValue() starts for the Indicators that do that ...

CODE:
//calculate partial value public override bool CalculatePartialValue() { StreamingValue = Double.NaN; TimeSeries source = Parameters[0].AsTimeSeries; if (Double.IsNaN(source.StreamingValue)) return false; Int32 period = Parameters[1].AsInt; : :
0

Reply

Bookmark

Sort