How to get study values

jwilliams9090

New member
Joined
Feb 4, 2024
Posts
3
Likes
0
I have a study on a chart, for example a TPO or a Delta Volume Imprint chart, and I want to get the values within the elements of that study? For example if I have a volume imprint of delta how would I get the values the elements within the delta bar? Or for a TPO chart, how would I get the different elements of D period for example. I want to get the values of a study that I have created manually from a java api. Any help is appreciated I am not sure what words I should be searching for in the documentation, so far I haven't had any luck.
 

Spin

Well-known member
Joined
May 22, 2019
Posts
480
Likes
192
Hello and welcome to the MW-forums @jwilliams9090 !! :)

When you say you 'want' those values: do you want them printed on screen somewhere ?
Or do you want to (re)use them in a calculation ?

For the first question, you would need to output them like so (this is to be written in your 'Initialize'-function):
Java:
RuntimeDescriptor desc = new RuntimeDescriptor();
        desc.exportValue(new ValueDescriptor(Values.index, Enums.ValueType.INTEGER, get("Index"), null));
        desc.exportValue(new ValueDescriptor(Values.FVG_DOWN, Enums.ValueType.INTEGER, get("FVG Down"), null));
setRuntimeDescriptor(desc);

And for the second question, you would have to 'write' or 'store' a value to the DataSeries first, to be able to reuse it later:
Java:
series.setInt(i, Values.index, index);

Look in the SDK-sample Studies: many examples there ! ;)
 

jwilliams9090

New member
Joined
Feb 4, 2024
Posts
3
Likes
0
Thanks. This is actually my first motivewave app. I started by loading and running the examples, Eclipse. I just want to take a delta bar or a TPO period and do some analysis on it, for example grab the F period values or get the delta bar for a period and get the Delta/Delta % for a bar. So it looks like RuntimeDescriptor and series data is what I am looking for. Thanks again, I just wasn't sure where to start.
 
Top