---
id: "M:cAlgo.API.AbsoluteTakeProfitProtection.#ctor(System.Double,System.Double)"
kind: "constructor"
type: "T:cAlgo.API.AbsoluteTakeProfitProtection"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/AbsoluteTakeProfitProtection/Constructor/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# AbsoluteTakeProfitProtection constructor

Member of [AbsoluteTakeProfitProtection](https://help.ctrader.com/ctrader-algo/references/Trading/AbsoluteTakeProfitProtection/index.md).

## AbsoluteTakeProfitProtection(double Volume, double Price)

Represents a partial take profit closing a portion of the order volume at an absolute price.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public AbsoluteTakeProfitProtection(double Volume, double Price)
```

Python:

```python
AbsoluteTakeProfitProtection(Volume: float, Price: float)
```

### Parameters

- `Volume` (`double`, Python `float`): The portion of the order volume to close when the take profit is triggered.
- `Price` (`double`, Python `float`): The absolute price at which the take profit is triggered.

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var position = Positions.Find("myLabel");
if (position != null && position.TradeType == TradeType.Buy)
{
    var pipSize = position.Symbol.PipSize;
    var halfVolume = position.Symbol.NormalizeVolumeInUnits(position.VolumeInUnits / 2, RoundingMode.Down);
    var firstTakeProfit = new AbsoluteTakeProfitProtection(halfVolume, position.EntryPrice + 20 * pipSize);
    var takeProfits = new AbsoluteTakeProfitProtections(firstTakeProfit, new AbsoluteTakeProfitLastProtection(position.EntryPrice + 40 * pipSize));
    Print("Take profit ladder set: {0}", position.ModifyTakeProfit(takeProfits).IsSuccessful);
}
```

Python:

```python
position = api.Positions.Find("myLabel")
if position is not None and position.TradeType == TradeType.Buy:
    pipSize = position.Symbol.PipSize
    halfVolume = position.Symbol.NormalizeVolumeInUnits(position.VolumeInUnits / 2, RoundingMode.Down)
    firstTakeProfit = AbsoluteTakeProfitProtection(halfVolume, position.EntryPrice + 20 * pipSize)
    takeProfits = AbsoluteTakeProfitProtections(firstTakeProfit, AbsoluteTakeProfitLastProtection(position.EntryPrice + 40 * pipSize))
    api.Print(f"Take profit ladder set: {position.ModifyTakeProfit(takeProfits).IsSuccessful}")
```

## AbsoluteTakeProfitProtection(AbsoluteTakeProfitProtection original)



Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public AbsoluteTakeProfitProtection(AbsoluteTakeProfitProtection original)
```

Python:

```python
AbsoluteTakeProfitProtection(original: AbsoluteTakeProfitProtection)
```

### Parameters

- `original` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`):

Available since cAlgo.API 5.8.

