Trading features configuration
You can configure trading features using the broker_config property of the Widget Constructor.
This property is primarily used to specify the configFlags object, which contains a list of configuration flags.
Some flags only enable or disable trading elements in the UI,
while others activate more advanced features that require corresponding methods to be implemented in the Broker API.
Consider the Widget Constructor with the following properties.
const datafeed = new Datafeeds.UDFCompatibleDatafeed("https://demo-feed-data.tradingview.com");
new TradingView.widget({
    container: "chartContainer",
    locale: "en",
    library_path: "charting_library/",
    datafeed: datafeed,
    symbol: "AAPL",
    interval: "1D",
    broker_factory: function(host) { return new Brokers.BrokerDemo(host, datafeed); },
    broker_config: {
        configFlags: {
            supportEditAmount: false,
            supportPositionNetting: true,
        },
    },
})
In the code sample, the supportEditAmount flag disables the order quantity control in the Order Ticket when users modify orders.
This flag only affects the UI.
The supportPositionNetting flag enables position netting.
Once activated, this flag adds two new pages to the Account Manager within Positions: Individual Positions and Net Positions.
However, in addition to enabling supportPositionNetting, you should also implement the following methods:
individualPositionsfor handling individual positionspositionsfor handling net positions