RelativeStopLossProtection
record cAlgo.API Since 5.8
DesktopCLICloud
Represents a stop loss defined as a distance (in pips) from the order's entry price.
Definition
public class RelativeStopLossProtection
Namespace: cAlgo.API · Group: Trading
Examples
var takeProfits = new RelativeTakeProfitProtections(new RelativeTakeProfitLastProtection(40));
var result = ExecuteMarketOrder(TradeType.Buy, SymbolName, 10000, "myLabel", new RelativeStopLossProtection(20), takeProfits);
if (result.IsSuccessful)
Print("Stop loss price: {0}", result.Position.StopLoss);
takeProfits = RelativeTakeProfitProtections(RelativeTakeProfitLastProtection(40))
result = api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, 10000, "myLabel", RelativeStopLossProtection(20), takeProfits)
if result.IsSuccessful:
api.Print(f"Stop loss price: {result.Position.StopLoss}")
Constructors
| Name | Description |
|---|---|
| RelativeStopLossProtection 2 overloadsDesktopCLICloud | Represents a stop loss defined as a distance (in pips) from the order's entry price. |
Properties
| Name | Description |
|---|---|
DistanceDesktopCLIClouddouble | The stop loss distance, in pips, from the order's entry price. |