Skip to content

ChartRiskReward.Time2

property · ChartRiskReward · cAlgo.API Since 5.2

DesktopCLICloud

Gets or sets the value 2 on the Time line.

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

DateTime Time2 {get; set;}
chartRiskReward.Time2: DateTime

Returns DateTime

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.Time2 = Bars.OpenTimes.LastValue.AddHours(4);
Print("Risk reward end time: {0}", riskReward.Time2);
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.Time2 = api.Bars.OpenTimes.LastValue.AddHours(4)
api.Print(f"Risk reward end time: {riskReward.Time2}")