- ago
Hi, I'm trying to use the most up-to-date streaming Close with the following code. Once attached to a chart and set to stream during trading I should be able to see the header text. But it's not showing.


CODE:
if (Bars.HasStreamingBar)    {     Bars.Close[Lastbar] = Bars.Close.StreamingValue;           DrawHeaderText("Real Time", WLColor.White, 12);    }
0
721
7 Replies

Reply

Bookmark

Sort
- ago
#1
QUOTE:
Bars.Close[Lastbar] = Bars.Close.StreamingValue;

What's the purpose of trying to overwrite the last bar (e.g. yesterday) with the partial bar's close (e.g. today's)?
0
- ago
#2
The goal is to get the most up-to-date streaming Price.

Bars.HasStreamingBar does not seem to work. Since I run it during streaming period and the condition is not true. What's listed is a translation from WL6 code that worked.
I welcome the correct way to accomplish the task in WL8.

P.S> The resolution is not day but minutes.
0
- ago
#3
What's your streaming provider? Bars.HasStreamingBar should work if the streaming provider is IB, TD or Alpaca.
0
- ago
#4
It is IB.
Is there something I can try/test?
0
Glitch8
 ( 11.39% )
- ago
#5
WL isn't set up to work with a streaming price in a strategy. At the point in time that a strategy fires and executes, the closing price will be equal to whatever the current streaming price is anyway.
0
- ago
#6
Please note above - the strategy is "attached" to a streaming chart during trading hours.
The condition below is not true. I'm using WL8 build 12 with IB provider build 8

CODE:
if (Bars.HasStreamingBar) { DrawHeaderText("Real Time bar", WLColor.White, 12); }
0
Cone8
 ( 6.27% )
- ago
#7
Worked for me. Maybe you didn't wait for the chart to finish it's first streaming interval?

0

Reply

Bookmark

Sort