CLI questions
CLI questions
13 Jul 2023, 18:22
Running cBot via CLI is a great feature, I have several questions:
1. Is there a way to stop the cBot via CLI or via external code code. Just like I use CLI instead of pressing the Play button I want a way to simulate the Stop button without have to close the CLI window manually.
2.Can I run a cBot in backtesting mode via CLI?
Thanks
Replies
PanagiotisChar
14 Jul 2023, 16:47
Hi eynt,
OnStop() is only called when the cBot closes itself. If you need to invoke this from an external source then you would need to implement some kind of communication with the cBot e.g. using files or named pipes.
Need help? Join us on Telegram
@PanagiotisChar
PanagiotisChar
14 Jul 2023, 17:02
Hi eynt,
I don't have one but if you google it you will find a lot of info.
Need help? Join us on Telegram
@PanagiotisChar
eynt
14 Jul 2023, 17:17
RE:
Suppose I'm using a file to communicate with the cBot. I'm guessing you meant the order to stop the cBot will be read at the OnTick method and the cBot will stop itself.
This means the order to stop the cBot has to be sent before tradinig session hours are over otherwise the OnTick method will not be called on time.
Any idea on how to send the order AFTER tradinig session hours?
Thank you for your help
@eynt
PanagiotisChar
17 Jul 2023, 09:37
Hi eynt,
You can use the Timer.
Need help? Join us on Telegram
@PanagiotisChar
ncel01
03 Aug 2023, 10:39
As far as I know, the OnStop() is not only called when the cBot stops by itself but also when pressing the stop button (via cTrader).
Not having this option available via CLI seems to be a huge limitation.
This could be easly achieved through commands if these are made available and, after all, these are the main purpose of a CLI.
@ncel01
PanagiotisChar
14 Jul 2023, 09:37
Hi eynt,
1. You can kill the process
2. No such feature is documented at the moment.
Aieden Technologies
Need help? Join us on Telegram
@PanagiotisChar