1.-
I want to code an indicator that has fix max and min values on the panel. It should not rescale when I change the length of market data displayed.
2.-
Also I want that two lines or more on the same indicator share the same x axis (0 line). Currently two x axis are created.
Can anyone tell me how to do that with the API?
Thanks
Indicators without dynamic scaling
-
- Posts: 545
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 22 times
- Been thanked: 83 times
Re: Indicators without dynamic scaling
Create an axis group to share the axis and axis rules to set boundaries. This is for the bottom panel only.
Code: Select all
...
indicatorOne = api.registerIndicator("One", GraphType.BOTTOM);
indicatorTwo = api.registerIndicator("Two", GraphType.BOTTOM);
Code: Select all
AxisGroup group = new AxisGroup();
//add indicators to the group to share the axis
group.add(indicatorOne);
group.add(indicatorTwo);
//add rules to set boundaries
AxisRules rules = new AxisRules();
rules.setForcedMax(14_500.0);
rules.setForcedMin(14_000.0);