Skip to main content

RiskToReward Tools

Add to Chart:

Use a BG.charts.Controller object to add one of the tools to a chart:

const short = controller.addTool('RiskToRewardShort');
const long = controller.addTool('RiskToRewardLong');

The tools have an optional $ Trade button, which can be enabled by setting the chartTradingButton option to true;

long.set('chartTradingButton', true);

Events:

#values

  • Type

    interface RiskToRewardLong {
    emit(type: 'values', data: {
    entry: number,
    stopLoss: number,
    takeProfit: number,
    });
    }
  • Details

    The tools emit an event values when the user clicks on the chartTradingButton.

  • Example

        // example usage:
    long.on('values', (data) => {
    console.log(data);
    });

Public methods:

The tools do not have any public methods which need to be called.