Skip to content

ChartRiskReward.IsFixedRatio

property · ChartRiskReward · cAlgo.API Since 5.2

DesktopCLICloud

Gets or sets if risk reward ratio is fixed or not.

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

bool IsFixedRatio {get; set;}
chartRiskReward.IsFixedRatio: bool

Returns bool

Examples

var riskReward = Chart.DrawRiskReward("rr", Bars.OpenTimes.Last(10), Bars.OpenTimes.LastValue, Symbol.Ask, OrderType.Market, TradeType.Buy, new ChartRiskRewardFixedRiskType(ChartRiskRewardAmountType.BalancePercentage, 1));
riskReward.IsFixedRatio = true;
riskReward.RiskRewardRatio = 2;
Print("Ratio is fixed: {0}", riskReward.IsFixedRatio);
riskReward = api.Chart.DrawRiskReward("rr", api.Bars.OpenTimes.Last(10), api.Bars.OpenTimes.LastValue, api.Symbol.Ask, OrderType.Market, TradeType.Buy, ChartRiskRewardFixedRiskType(ChartRiskRewardAmountType.BalancePercentage, 1))
riskReward.IsFixedRatio = True
riskReward.RiskRewardRatio = 2
api.Print(f"Ratio is fixed: {riskReward.IsFixedRatio}")