cBots don't working - Help!!!

Created at 18 Aug 2023, 13:08
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!
RA

rafaelfonts.silveira

Joined 18.08.2023

cBots don't working - Help!!!
18 Aug 2023, 13:08


Hello everyone, how are you?
I have a problem for 2 days and I want your help to solve it.

I migrated to cTrader and installed the most current version to automate my operations, I made a cBot and tried to run it yesterday, but without success.

When making the code the Build returned success, even so the cBot did not open any order, so I thought that the problem could be in the code. I tested some cBots native to the platform and none of them worked either.

My last attempt was to code a cBot with just the function of opening market orders:
ExecuteMarketOrder(TradeType.Buy, SymbolName, "", 10, 10, "");
Again, Build successful and no order was placed by cBot.

I am using Windows 11, cTrader version 4.8.21
Any suggestion?


@rafaelfonts.silveira
Replies

firemyst
18 Aug 2023, 13:10 ( Updated at: 18 Aug 2023, 13:13 )

Any suggestion?

Yes. Read the actual parameters to the API call and what you're passing.

For instance, your third parameter, you have “”. That's the VOLUME parameter. How can you have “” for volume?

 


@firemyst

rafaelfonts.silveira
18 Aug 2023, 13:32 ( Updated at: 21 Dec 2023, 09:23 )

RE: cBots don't working - Help!!!

firemyst said: 

Any suggestion?

Yes. Read the actual parameters to the API call and what you're passing.

For instance, your third parameter, you have “”. That's the VOLUME parameter. How can you have “” for volume?

 

Hello firemyst. Thanks a lot for your answer, I changed the code to the version below:

ExecuteMarketOrder(TradeType.Buy, SymbolName, 0.01, "", 10, 10, "", false);

The volume parameter is second, right after SymbolName, still no order placed when running the cBot.

This code is just an example so that I can discover the real problem, because none of the platform's native cBots are working, I tested several and none of them placed orders when executed.


@rafaelfonts.silveira

firemyst
18 Aug 2023, 14:47

And what symbol are you trying to place an order against?


@firemyst

firemyst
18 Aug 2023, 14:48 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE: cBots don't working - Help!!!

rafaelfonts.silveira said: 

firemyst said: 

Any suggestion?

Yes. Read the actual parameters to the API call and what you're passing.

For instance, your third parameter, you have “”. That's the VOLUME parameter. How can you have “” for volume?

 

Hello firemyst. Thanks a lot for your answer, I changed the code to the version below:

ExecuteMarketOrder(TradeType.Buy, SymbolName, 0.01, "", 10, 10, "", false);

The volume parameter is second, right after SymbolName, still no order placed when running the cBot.

This code is just an example so that I can discover the real problem, because none of the platform's native cBots are working, I tested several and none of them placed orders when executed.

What symbol are you trying to place an order on?


@firemyst

rafaelfonts.silveira
18 Aug 2023, 15:02 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE: RE: cBots don't working - Help!!!

firemyst said: 

rafaelfonts.silveira said: 

firemyst said: 

Any suggestion?

Yes. Read the actual parameters to the API call and what you're passing.

For instance, your third parameter, you have “”. That's the VOLUME parameter. How can you have “” for volume?

 

Hello firemyst. Thanks a lot for your answer, I changed the code to the version below:

ExecuteMarketOrder(TradeType.Buy, SymbolName, 0.01, "", 10, 10, "", false);

The volume parameter is second, right after SymbolName, still no order placed when running the cBot.

This code is just an example so that I can discover the real problem, because none of the platform's native cBots are working, I tested several and none of them placed orders when executed.

What symbol are you trying to place an order on?

For these attempts I am using EURUSD and XAUUSD


@rafaelfonts.silveira

rafaelfonts.silveira
18 Aug 2023, 15:04 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE: RE: cBots don't working - Help!!!

firemyst said: 

rafaelfonts.silveira said: 

firemyst said: 

Any suggestion?

Yes. Read the actual parameters to the API call and what you're passing.

For instance, your third parameter, you have “”. That's the VOLUME parameter. How can you have “” for volume?

 

Hello firemyst. Thanks a lot for your answer, I changed the code to the version below:

ExecuteMarketOrder(TradeType.Buy, SymbolName, 0.01, "", 10, 10, "", false);

The volume parameter is second, right after SymbolName, still no order placed when running the cBot.

This code is just an example so that I can discover the real problem, because none of the platform's native cBots are working, I tested several and none of them placed orders when executed.

What symbol are you trying to place an order on?

For these attempts I am using EURUSD and XAUUSD


@rafaelfonts.silveira

firemyst
18 Aug 2023, 15:14

RE: RE: RE: RE: cBots don't working - Help!!!

rafaelfonts.silveira said: 

firemyst said: 

What symbol are you trying to place an order on?

For these attempts I am using EURUSD and XAUUSD

And how do you know your broker allows you to buy .01 lots of EURUSD and XAUUSD?

Some brokers don't allow micro lots.


@firemyst

PanagiotisChar
18 Aug 2023, 15:31

Hi there,

Try this instead

ExecuteMarketOrder(TradeType.Buy, SymbolName, Symbol.NormalizeVolumeInUnits(0.01),"", 10, 10, "");

Aieden Technologies

Need help? Join us on Telegram


 


@PanagiotisChar