3.8.4.6Populating the chart's deal ticket

You can populate the chart's deal ticket by including a dealTicketState object which contains an orderDefinition. For example:

Framework.CreateDialog({

…,

settings: {

dealTicketState: {

orderDefinition: {

tradingAction: FXB.OrderTypes.SELL,

volume: 30000,

sl: {pips: 20}

}

},

}

});

The orderDefinition uses the same format as a request to SendOrder(). Note: if the orderDefinition contains an instrumentId, then that is overridden and ignored by any use of context:{} to set the instrument for the chart.

If you are using CreateDialog() to display a chart with a deal ticket, you will commonly want to set closeOnOrderPlacement so that the chart closes automatically when/if the user places a trade.