



Risk-Reward Calculator Plugin
The Risk-Reward plugin is a tool to visualize a trading idea based on other analysis tools, such as the HAI Quantum The_Game indicator.
Based on these indicators, it calculates and predicts a potential price movement. By defining conditions like the amount you are willing to spend and the loss/profit ratio you propose, it calculates your potential loss and the benefit you can achieve if the market moves in your favor.
The available parameters are:
- Order Type
- Market
- Limit (for sell orders)
- Stop (for buy orders)
- Stop-limit (for both)
- Direction
- Buy
- Sell
- Calculation Mode
- Risk (how much you are willing to risk)
- Reward (how much you want to earn)
- Size (the volume you want to buy/sell)
- Ratio - The proportion between loss and profit.
The other parameters are irrelevant because they don't directly influence the decision; they only inform you of the potential loss and/or gain based on the conditions you have set.
No matter which option you choose in Order Type or Calculation Mode, everything is ultimately limited by the amount you can buy (whether it's 0.01 lots or 10 lots).
For example, if you choose to invest 5% or 10% of your balance, this doesn't mean you will use all of that money. The minimum lot size is 0.01, and depending on your broker's conditions, this could cost $2.00 or $50.00. So, if you have $6,000.00 in your account, you might be able to buy 30 lots in the first scenario, but only one lot in the second, even if you are aiming to use 10% of your balance.
And regardless of how you configure it, this tool does not directly influence trading. It does not execute transactions for you or close them. It's just a "cinematic gadget" to show the market's progress and to give the illusion of gaining what the Reward calculation shows or losing what the Risk calculation indicates.
To simplify this concept, I have prepared this plugin with the most relevant options.
The Order Type has two options: Market and Stop/Limits.
- With the Market option, when you press "Place Risk-Reward Order," it places the Risk-Reward tool at the ask price (for a buy) or the bid price (for a sell) with the conditions you've set.
- Once the Risk-Reward tool is placed on the chart, you can modify any of its options.
- With the Stop/Limits option selected, the entry price must be manually set. When you press the button, the Risk-Reward tool is placed at the chosen price with your specified conditions.
The Calculation Mode has three options: Size, Risk, and Reward.
- Size lets you directly modify the lot size.
- Risk and Reward allow you to choose between Lots, % of Balance, or % of Equity, where you can select the percentage of your account balance to allocate to the trade.
- These options automatically calculate the lot size you can buy. The calculation is reflected in the hint below the input fields.
The last option you can modify is the Risk Reward Ratio, which recalculates the proportion between your loss and profit.
The buttons at the top indicate whether you will be placing a sell or a buy order, allowing you to position the appropriate Risk-Reward tool on the chart.
The stop-loss and take-profit are calculated based on the simple 14-period ATR.
Technique used C#, Algo.Api, Html, JavaScript, framework: tailwind.
Each click of the button adds a new Risk-Reward. Remove manually with Object Manager.
https://ctrader.com/products/1960?u=Thomas-Sparrow
https://ctrader.com/products/1759?u=Thomas-Sparrow