Skip to content

RelativeTakeProfitProtection

record cAlgo.API Since 5.8

DesktopCLICloud

Represents a partial take profit closing a portion of the order volume at a distance (in pips) from the entry price.

Definition

public class RelativeTakeProfitProtection

Namespace: cAlgo.API · Group: Trading

Examples

var firstTakeProfit = new RelativeTakeProfitProtection(10000, 20);
var takeProfits = new RelativeTakeProfitProtections(firstTakeProfit, new RelativeTakeProfitLastProtection(40));
var result = ExecuteMarketOrder(TradeType.Buy, SymbolName, 20000, "myLabel", new RelativeStopLossProtection(20), takeProfits);
Print("Half of the position closes {0} pips from entry: {1}", firstTakeProfit.Distance, result.IsSuccessful);
firstTakeProfit = RelativeTakeProfitProtection(10000, 20)
takeProfits = RelativeTakeProfitProtections(firstTakeProfit, RelativeTakeProfitLastProtection(40))
result = api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, 20000, "myLabel", RelativeStopLossProtection(20), takeProfits)
api.Print(f"Half of the position closes {firstTakeProfit.Distance} pips from entry: {result.IsSuccessful}")

Constructors

Name Description
RelativeTakeProfitProtection 2 overloadsDesktopCLICloud Represents a partial take profit closing a portion of the order volume at a distance (in pips) from the entry price.

Properties

Name Description
DistanceDesktopCLIClouddouble The take profit distance, in pips, from the order's entry price.
VolumeDesktopCLIClouddouble The portion of the order volume to close when the take profit is triggered.