- ago
I am testing some logic and can't see where my gap is, and I would like to be able to display the variable value at each bar. Is there a way to do something like a "DrawText" or similar with a variable?
0
142
Solved
5 Replies

Reply

Bookmark

Sort
- ago
#1
You can pass any string to DrawText. What's the problem?
0
Best Answer
Cone8
 ( 3.70% )
- ago
#2
For "at each bar" use WriteToDebugLog and then see the Debug log.
CODE:
//example: WriteToDebugLog($"{idx}\t{myVariable:N4}")
0
Glitch8
 ( 8.31% )
- ago
#3
I think the best way is to create a TimeSeries, plot the TimeSeries, and set the values of your variable into the TimeSeries on each bar.
2
- ago
#4
I like the method discussed in Post #3 the best. If you're using that approach, you can go to the View menu and open View > Data Panel to get a look and all the TimeSeries values on the Chart, which is handy.

If there's a specific bar you want to look at, then try DrawBarAnnotation as well. You could put that in a FOR loop and annotate every single bar, but that would be kind of messy.
0
- ago
#5
Thanks all, I figured out that the variable_name.toString() in DrawText was what I needed.

I'll try the TimeSeries next - that would also be helpful.
0

Reply

Bookmark

Sort