Indicators without dynamic scaling

Custom indicators, trading strategies, data export and recording and more...
hedgefair
Posts: 11
Joined: Wed Nov 13, 2019 6:49 pm

Indicators without dynamic scaling

Post by hedgefair » Fri Dec 27, 2019 2:49 pm

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

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Indicators without dynamic scaling

Post by Andry API support » Fri Dec 27, 2019 3:29 pm

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);

Post Reply