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

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

# AbsoluteTakeProfitProtections constructor

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

## AbsoluteTakeProfitProtections(AbsoluteTakeProfitLastProtection lastTakeProfit)

Initializes a new instance with only a final take profit.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public AbsoluteTakeProfitProtections(AbsoluteTakeProfitLastProtection lastTakeProfit)
```

Python:

```python
AbsoluteTakeProfitProtections(lastTakeProfit: AbsoluteTakeProfitLastProtection)
```

### Parameters

- `lastTakeProfit` (`AbsoluteTakeProfitLastProtection`, Python `AbsoluteTakeProfitLastProtection`): The final take profit that closes the remaining volume.

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var entryPrice = Symbol.Bid - 20 * Symbol.PipSize;
var takeProfits = new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitLastProtection(entryPrice + 40 * Symbol.PipSize));
var result = PlaceLimitOrder(TradeType.Buy, SymbolName, 10000, entryPrice, "myLabel", new AbsoluteStopLossProtection(entryPrice - 20 * Symbol.PipSize), takeProfits);
Print("Order placed: {0}", result.IsSuccessful);
```

Python:

```python
entryPrice = api.Symbol.Bid - 20 * api.Symbol.PipSize
takeProfits = AbsoluteTakeProfitProtections(AbsoluteTakeProfitLastProtection(entryPrice + 40 * api.Symbol.PipSize))
result = api.PlaceLimitOrder(TradeType.Buy, api.SymbolName, 10000, entryPrice, "myLabel", AbsoluteStopLossProtection(entryPrice - 20 * api.Symbol.PipSize), takeProfits)
api.Print(f"Order placed: {result.IsSuccessful}")
```

## AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection firstTakeProfit, AbsoluteTakeProfitLastProtection lastTakeProfit)

Initializes a new instance with one partial take profit and a final take profit.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection firstTakeProfit, AbsoluteTakeProfitLastProtection lastTakeProfit)
```

Python:

```python
AbsoluteTakeProfitProtections(firstTakeProfit: AbsoluteTakeProfitProtection, lastTakeProfit: AbsoluteTakeProfitLastProtection)
```

### Parameters

- `firstTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The first partial take profit.
- `lastTakeProfit` (`AbsoluteTakeProfitLastProtection`, Python `AbsoluteTakeProfitLastProtection`): The final take profit that closes the remaining volume.

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var entryPrice = Symbol.Bid - 20 * Symbol.PipSize;
var pipSize = Symbol.PipSize;
var takeProfits = new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(10000, entryPrice + 20 * pipSize), new AbsoluteTakeProfitLastProtection(entryPrice + 40 * pipSize));
var result = PlaceLimitOrder(TradeType.Buy, SymbolName, 20000, entryPrice, "myLabel", new AbsoluteStopLossProtection(entryPrice - 20 * pipSize), takeProfits);
Print("Order placed: {0}", result.IsSuccessful);
```

Python:

```python
entryPrice = api.Symbol.Bid - 20 * api.Symbol.PipSize
pipSize = api.Symbol.PipSize
takeProfits = AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(10000, entryPrice + 20 * pipSize), AbsoluteTakeProfitLastProtection(entryPrice + 40 * pipSize))
result = api.PlaceLimitOrder(TradeType.Buy, api.SymbolName, 20000, entryPrice, "myLabel", AbsoluteStopLossProtection(entryPrice - 20 * pipSize), takeProfits)
api.Print(f"Order placed: {result.IsSuccessful}")
```

## AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection firstTakeProfit, AbsoluteTakeProfitProtection secondTakeProfit, AbsoluteTakeProfitLastProtection lastTakeProfit)

Initializes a new instance with two partial take profits and a final take profit.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection firstTakeProfit, AbsoluteTakeProfitProtection secondTakeProfit, AbsoluteTakeProfitLastProtection lastTakeProfit)
```

Python:

```python
AbsoluteTakeProfitProtections(firstTakeProfit: AbsoluteTakeProfitProtection, secondTakeProfit: AbsoluteTakeProfitProtection, lastTakeProfit: AbsoluteTakeProfitLastProtection)
```

### Parameters

- `firstTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The first partial take profit.
- `secondTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The second partial take profit.
- `lastTakeProfit` (`AbsoluteTakeProfitLastProtection`, Python `AbsoluteTakeProfitLastProtection`): The final take profit that closes the remaining volume.

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var entryPrice = Symbol.Bid - 20 * Symbol.PipSize;
var pipSize = Symbol.PipSize;
var takeProfits = new AbsoluteTakeProfitProtections(
    new AbsoluteTakeProfitProtection(10000, entryPrice + 15 * pipSize),
    new AbsoluteTakeProfitProtection(10000, entryPrice + 30 * pipSize),
    new AbsoluteTakeProfitLastProtection(entryPrice + 45 * pipSize));
var result = PlaceLimitOrder(TradeType.Buy, SymbolName, 30000, entryPrice, "myLabel", new AbsoluteStopLossProtection(entryPrice - 20 * pipSize), takeProfits);
Print("Order placed: {0}", result.IsSuccessful);
```

Python:

```python
entryPrice = api.Symbol.Bid - 20 * api.Symbol.PipSize
pipSize = api.Symbol.PipSize
takeProfits = AbsoluteTakeProfitProtections(
    AbsoluteTakeProfitProtection(10000, entryPrice + 15 * pipSize),
    AbsoluteTakeProfitProtection(10000, entryPrice + 30 * pipSize),
    AbsoluteTakeProfitLastProtection(entryPrice + 45 * pipSize))
result = api.PlaceLimitOrder(TradeType.Buy, api.SymbolName, 30000, entryPrice, "myLabel", AbsoluteStopLossProtection(entryPrice - 20 * pipSize), takeProfits)
api.Print(f"Order placed: {result.IsSuccessful}")
```

## AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection firstTakeProfit, AbsoluteTakeProfitProtection secondTakeProfit, AbsoluteTakeProfitProtection thirdTakeProfit, AbsoluteTakeProfitLastProtection lastTakeProfit)

Initializes a new instance with three partial take profits and a final take profit.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection firstTakeProfit, AbsoluteTakeProfitProtection secondTakeProfit, AbsoluteTakeProfitProtection thirdTakeProfit, AbsoluteTakeProfitLastProtection lastTakeProfit)
```

Python:

```python
AbsoluteTakeProfitProtections(firstTakeProfit: AbsoluteTakeProfitProtection, secondTakeProfit: AbsoluteTakeProfitProtection, thirdTakeProfit: AbsoluteTakeProfitProtection, lastTakeProfit: AbsoluteTakeProfitLastProtection)
```

### Parameters

- `firstTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The first partial take profit.
- `secondTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The second partial take profit.
- `thirdTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The third partial take profit.
- `lastTakeProfit` (`AbsoluteTakeProfitLastProtection`, Python `AbsoluteTakeProfitLastProtection`): The final take profit that closes the remaining volume.

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var entryPrice = Symbol.Bid - 20 * Symbol.PipSize;
var pipSize = Symbol.PipSize;
var takeProfits = new AbsoluteTakeProfitProtections(
    new AbsoluteTakeProfitProtection(10000, entryPrice + 15 * pipSize),
    new AbsoluteTakeProfitProtection(10000, entryPrice + 25 * pipSize),
    new AbsoluteTakeProfitProtection(10000, entryPrice + 35 * pipSize),
    new AbsoluteTakeProfitLastProtection(entryPrice + 50 * pipSize));
var result = PlaceLimitOrder(TradeType.Buy, SymbolName, 40000, entryPrice, "myLabel", new AbsoluteStopLossProtection(entryPrice - 20 * pipSize), takeProfits);
Print("Order placed: {0}", result.IsSuccessful);
```

Python:

```python
entryPrice = api.Symbol.Bid - 20 * api.Symbol.PipSize
pipSize = api.Symbol.PipSize
takeProfits = AbsoluteTakeProfitProtections(
    AbsoluteTakeProfitProtection(10000, entryPrice + 15 * pipSize),
    AbsoluteTakeProfitProtection(10000, entryPrice + 25 * pipSize),
    AbsoluteTakeProfitProtection(10000, entryPrice + 35 * pipSize),
    AbsoluteTakeProfitLastProtection(entryPrice + 50 * pipSize))
result = api.PlaceLimitOrder(TradeType.Buy, api.SymbolName, 40000, entryPrice, "myLabel", AbsoluteStopLossProtection(entryPrice - 20 * pipSize), takeProfits)
api.Print(f"Order placed: {result.IsSuccessful}")
```

## AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection firstTakeProfit, AbsoluteTakeProfitProtection secondTakeProfit, AbsoluteTakeProfitProtection thirdTakeProfit, AbsoluteTakeProfitProtection fourthTakeProfit, AbsoluteTakeProfitLastProtection lastTakeProfit)

Initializes a new instance with four partial take profits and a final take profit.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection firstTakeProfit, AbsoluteTakeProfitProtection secondTakeProfit, AbsoluteTakeProfitProtection thirdTakeProfit, AbsoluteTakeProfitProtection fourthTakeProfit, AbsoluteTakeProfitLastProtection lastTakeProfit)
```

Python:

```python
AbsoluteTakeProfitProtections(firstTakeProfit: AbsoluteTakeProfitProtection, secondTakeProfit: AbsoluteTakeProfitProtection, thirdTakeProfit: AbsoluteTakeProfitProtection, fourthTakeProfit: AbsoluteTakeProfitProtection, lastTakeProfit: AbsoluteTakeProfitLastProtection)
```

### Parameters

- `firstTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The first partial take profit.
- `secondTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The second partial take profit.
- `thirdTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The third partial take profit.
- `fourthTakeProfit` (`AbsoluteTakeProfitProtection`, Python `AbsoluteTakeProfitProtection`): The fourth partial take profit.
- `lastTakeProfit` (`AbsoluteTakeProfitLastProtection`, Python `AbsoluteTakeProfitLastProtection`): The final take profit that closes the remaining volume.

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var entryPrice = Symbol.Bid - 20 * Symbol.PipSize;
var pipSize = Symbol.PipSize;
var takeProfits = new AbsoluteTakeProfitProtections(
    new AbsoluteTakeProfitProtection(10000, entryPrice + 10 * pipSize),
    new AbsoluteTakeProfitProtection(10000, entryPrice + 20 * pipSize),
    new AbsoluteTakeProfitProtection(10000, entryPrice + 30 * pipSize),
    new AbsoluteTakeProfitProtection(10000, entryPrice + 40 * pipSize),
    new AbsoluteTakeProfitLastProtection(entryPrice + 60 * pipSize));
var result = PlaceLimitOrder(TradeType.Buy, SymbolName, 50000, entryPrice, "myLabel", new AbsoluteStopLossProtection(entryPrice - 20 * pipSize), takeProfits);
Print("Order placed: {0}", result.IsSuccessful);
```

Python:

```python
entryPrice = api.Symbol.Bid - 20 * api.Symbol.PipSize
pipSize = api.Symbol.PipSize
takeProfits = AbsoluteTakeProfitProtections(
    AbsoluteTakeProfitProtection(10000, entryPrice + 10 * pipSize),
    AbsoluteTakeProfitProtection(10000, entryPrice + 20 * pipSize),
    AbsoluteTakeProfitProtection(10000, entryPrice + 30 * pipSize),
    AbsoluteTakeProfitProtection(10000, entryPrice + 40 * pipSize),
    AbsoluteTakeProfitLastProtection(entryPrice + 60 * pipSize))
result = api.PlaceLimitOrder(TradeType.Buy, api.SymbolName, 50000, entryPrice, "myLabel", AbsoluteStopLossProtection(entryPrice - 20 * pipSize), takeProfits)
api.Print(f"Order placed: {result.IsSuccessful}")
```

## AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtections original)



Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtections original)
```

Python:

```python
AbsoluteTakeProfitProtections(original: AbsoluteTakeProfitProtections)
```

### Parameters

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

Available since cAlgo.API 5.8.

