Plugin.PlaceLimitOrder
method · Plugin · cAlgo.API
Place a Limit Order
Environment behaviour
CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.
Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.
Overloads
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask);
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask)
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel");
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel")
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative);
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative)
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), StopLossBreakEven(15, 3))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), StopLossBreakEven(15, 3))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None, expiration: DateTime | None) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
expiration | DateTime? | DateTime | None | Order expiry time |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), StopLossBreakEven(15, 3))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), StopLossBreakEven(15, 3))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None, expiration: DateTime | None, comment: str) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment");
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment")
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment");
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment")
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", StopLossBreakEven(15, 3))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment");
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment")
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", StopLossBreakEven(15, 3))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None, expiration: DateTime | None, comment: str, hasTrailingStop: bool) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true);
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True)
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true);
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True)
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopLossBreakEven(15, 3))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true);
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True)
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopLossBreakEven(15, 3))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
stopLossTriggerMethod | StopTriggerMethod? | StopTriggerMethod | None | Trigger method for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
stopLossTriggerMethod | StopTriggerMethod? | StopTriggerMethod | None | Trigger method for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
stopLossTriggerMethod | StopTriggerMethod? | StopTriggerMethod | None | Trigger method for position's StopLoss |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
stopLossTriggerMethod | StopTriggerMethod? | StopTriggerMethod | None | Trigger method for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)
PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
Place a Limit Order
public TradeResult PlaceLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopLossBreakEven: StopLossBreakEven) -> TradeResult
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
tradeType | TradeType | TradeType | Direction of trade |
symbolName | string | str | Symbol name of trade |
volume | double | float | Volume (in units) of trade |
targetPrice | double | float | Price (or better) at which order is filled |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
stopLossTriggerMethod | StopTriggerMethod? | StopTriggerMethod | None | Trigger method for position's StopLoss |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
api.PlaceLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))