Skip to content

ChartRiskRewardFixedRewardType

Summary

Represents fixed reward type of chart risk reward.

Signature

1
public class ChartRiskRewardFixedRewardType

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 using cAlgo.API;
 namespace cAlgo.Robots;
 [Robot(AccessRights = AccessRights.None)]
 public class TestExample : Robot
 {
     protected override void OnStart()
     {
         var riskRewardType = new ChartRiskRewardFixedRewardType(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}");
     }
 }
1
2
3
4
5
6
7
8
9
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():
     def initialize(self):
         riskRewardType = ChartRiskRewardFixedRewardType(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}")

Methods

ToString

Signature

1
public string ToString()

Return Value

string

PrintMembers

Signature

1
protected bool PrintMembers(StringBuilder builder)

Parameters

Name Type Description
builder StringBuilder

Return Value

bool

GetHashCode

Signature

1
public int GetHashCode()

Return Value

int

Equals (2)

Equals (1 of 2)

Signature

1
public bool Equals(object obj)

Parameters

Name Type Description
obj object

Return Value

bool

Equals (2 of 2)

Signature

1
public bool Equals(ChartRiskRewardFixedRewardType other)

Parameters

Name Type Description
other ChartRiskRewardFixedRewardType

Return Value

bool

$

Signature

1
public ChartRiskRewardFixedRewardType <Clone>$()

Return Value

ChartRiskRewardFixedRewardType

Properties

AmountType

Summary

Gets or sets amount mode.

Signature

1
public ChartRiskRewardAmountType AmountType {get;}

Return Value

ChartRiskRewardAmountType

Amount

Summary

Gets or sets amount.

Signature

1
public double Amount {get;}

Return Value

double