RelativeTakeProfitLastProtection constructor
constructor · RelativeTakeProfitLastProtection · cAlgo.API Since 5.8
DesktopCLICloud
Represents the final take profit in a relative take profit ladder, closing the remaining order volume at a distance (in pips) from the entry price.
Overloads
| Signature | Description |
|---|---|
RelativeTakeProfitLastProtection(double Distance) | Represents the final take profit in a relative take profit ladder, closing the remaining order volume at a distance (in pips) from the entry price. |
RelativeTakeProfitLastProtection(RelativeTakeProfitLastProtection original) |
RelativeTakeProfitLastProtection(double Distance)
Represents the final take profit in a relative take profit ladder, closing the remaining order volume at a distance (in pips) from the entry price.
public RelativeTakeProfitLastProtection(double Distance)
RelativeTakeProfitLastProtection(Distance: float)
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
Distance | double | float | The take profit distance, in pips, from the order's entry price. |
Examples
var takeProfits = new RelativeTakeProfitProtections(new RelativeTakeProfitLastProtection(40));
var result = ExecuteMarketOrder(TradeType.Sell, SymbolName, 10000, "myLabel", new RelativeStopLossProtection(20), takeProfits);
if (result.IsSuccessful)
Print("Take profit price: {0}", result.Position.TakeProfit);
takeProfits = RelativeTakeProfitProtections(RelativeTakeProfitLastProtection(40))
result = api.ExecuteMarketOrder(TradeType.Sell, api.SymbolName, 10000, "myLabel", RelativeStopLossProtection(20), takeProfits)
if result.IsSuccessful:
api.Print(f"Take profit price: {result.Position.TakeProfit}")
RelativeTakeProfitLastProtection(RelativeTakeProfitLastProtection original)
public RelativeTakeProfitLastProtection(RelativeTakeProfitLastProtection original)
RelativeTakeProfitLastProtection(original: RelativeTakeProfitLastProtection)
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
original | RelativeTakeProfitLastProtection | RelativeTakeProfitLastProtection |