Spin
Well-known member
- Joined
- May 22, 2019
- Posts
- 496
- Likes
- 205
All SDK-users know the hassle: you want to check something (a value, a marker being plotted correctly, a color change, ...) on a specific bar in the past, but you only have the 'index' to work with. So that typically means using the ruler tool extensively or counting bars manually.
But when you import these into your study:
And then drop this somewhere in one of your functions
You get this:
And that makes (my) life a lot easier
But when you import these into your study:
Java:
import java.util.*;
import java.text.*;
And then drop this somewhere in one of your functions
Java:
DataSeries series = ctx.getDataSeries();
long time = series.getStartTime(index);
DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
String formatted = format.format(time);
debug (index + " " + formatted + " someValue = " + someValue);
You get this:
And that makes (my) life a lot easier
Last edited: