TrailingStop in ExecuteMarketOrder

Created at 31 Mar 2020, 21:00
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
irmscher9's avatar

irmscher9

Joined 22.12.2016

TrailingStop in ExecuteMarketOrder
31 Mar 2020, 21:00


Hi there

ExecuteMarketOrder(TradeType.Buy, Symbol, 10000, "myLabel", 8, 10, 2, "comment", true);

After "myLabel" there are 3 numbers. 

- What is 8?

- What is 10?

- And what is 2?

- Is "comment" necessary? Because cTrader gives me an error when I remove it.

 

Thank you


@irmscher9
Replies

firemyst
01 Apr 2020, 14:11

RE:

irmscher9 said:

Hi there

ExecuteMarketOrder(TradeType.Buy, Symbol, 10000, "myLabel", 8, 10, 2, "comment", true);

After "myLabel" there are 3 numbers. 

- What is 8?

- What is 10?

- And what is 2?

- Is "comment" necessary? Because cTrader gives me an error when I remove it.

 

Thank you

It's in the API documentation:

 

ExecuteMarketOrder method you have, the parameters are the trade type, the symbol and the volume. The additional optional parameters are label, stop loss, take profit, slippage and the comment, ans whether or not it has a trailing stop.

"Comment" isn't necessary, but the parameter itself is required in this case. If you don't want a comment, set it to an empty string or null.

 


@firemyst

irmscher9
03 Apr 2020, 19:51

RE: RE:

Ok, I have 2 questions then if you don't mind

1. How does the Trailing Stop work then? Because I though "2" is an offset.

2. How does the slippage work, in our case it's set to 2? What does it mean then?

 

firemyst said:

irmscher9 said:

Hi there

ExecuteMarketOrder(TradeType.Buy, Symbol, 10000, "myLabel", 8, 10, 2, "comment", true);

After "myLabel" there are 3 numbers. 

- What is 8?

- What is 10?

- And what is 2?

- Is "comment" necessary? Because cTrader gives me an error when I remove it.

 

Thank you

It's in the API documentation:

 

ExecuteMarketOrder method you have, the parameters are the trade type, the symbol and the volume. The additional optional parameters are label, stop loss, take profit, slippage and the comment, ans whether or not it has a trailing stop.

"Comment" isn't necessary, but the parameter itself is required in this case. If you don't want a comment, set it to an empty string or null.

 

 


@irmscher9