ChartRiskReward
interface cAlgo.API Since 5.2
DesktopCLICloud
Represents the risk reward chart object.
Environment behaviour
CLI — works differently. Created and kept with all its properties, but never drawn: the CLI displays no chart.
Cloud — works differently. Created and kept with all its properties, but never drawn: the cloud displays no chart.
Definition
public interface ChartRiskReward
Namespace: cAlgo.API · Group: Drawings · Implements: ChartObject
Examples
using cAlgo.API;
namespace cAlgo.Robots;
public partial class TestExample : Robot
{
protected override void OnStart()
{
var riskRewardType = new ChartRiskRewardFixedRiskType(ChartRiskRewardAmountType.EquityPercentage, 1);
var riskReward = Chart.DrawRiskReward("RR", Chart.LastVisibleBarIndex - 10, Chart.LastVisibleBarIndex, Bars.ClosePrices[Chart.LastVisibleBarIndex], OrderType.Market, TradeType.Buy, riskRewardType);
riskReward.IsInteractive = true;
Print($"Name: {riskReward.Name} | Entry: {riskReward.EntryPrice}");
}
}
import clr
clr.AddReference("cAlgo.API")
from cAlgo.API import *
class Test():
def initialize(self):
riskRewardType = ChartRiskRewardFixedRiskType(ChartRiskRewardAmountType.EquityPercentage, 1)
riskReward = api.Chart.DrawRiskReward("RR", api.Chart.LastVisibleBarIndex - 10, api.Chart.LastVisibleBarIndex, api.Bars.ClosePrices[api.Chart.LastVisibleBarIndex], OrderType.Market, TradeType.Buy, riskRewardType)
riskReward.IsInteractive = True
print(f"Name: {riskReward.Name} | Entry: {riskReward.EntryPrice}")
{
"AccessRights": "None"
}
Properties
| Name | Description |
|---|---|
EntryPriceDesktopCLIClouddouble | Gets or sets the entry price. |
IsFixedRatioDesktopCLICloudbool | Gets or sets if risk reward ratio is fixed or not. |
IsMarketRangeDesktopCLICloudbool | Gets or sets if order type is market range. |
LimitRangePipsDesktopCLIClouddouble | Gets or sets order limit range pips amount. |
MarketRangePipsDesktopCLIClouddouble | Gets or sets order market range pips amount. |
OrderTypeDesktopCLICloudOrderType | Gets or sets the order type. |
RewardColorDesktopCLICloudColor | Gets or sets the reward color. |
RewardLineStyleDesktopCLICloudLineStyle | Gets or sets the reward style. |
RewardThicknessDesktopCLICloudint | Gets or sets the reward thickness. |
RiskColorDesktopCLICloudColor | Gets or sets the risk color. |
RiskLineStyleDesktopCLICloudLineStyle | Gets or sets the risk line style. |
RiskRewardRatioDesktopCLIClouddouble | Gets or sets risk reward ratio. |
RiskThicknessDesktopCLICloudint | Gets or sets the risk line thickness. |
StopLossPriceDesktopCLIClouddouble | Gets or sets the stop loss price. |
TakeProfitPriceDesktopCLIClouddouble | Gets or sets the take profit price. |
Time1DesktopCLICloudDateTime | Gets or sets the value 1 on the Time line. |
Time2DesktopCLICloudDateTime | Gets or sets the value 2 on the Time line. |
TradeTypeDesktopCLICloudTradeType | Gets or sets the trade type. |
TypeDesktopCLICloudChartRiskRewardType | Gets or sets type. |
VolumeInUnitsDesktopCLIClouddouble | Gets or sets the volume (in units). |
Inherited members
From ChartObject: Name, Comment, ObjectType, IsInteractive, IsLocked, IsHidden, ZIndex, IsAlive