Can cBot shutdown cTrader
Can cBot shutdown cTrader
14 Apr 2020, 07:41
Hi,
Is there a way for a cBot to be able to shutdown cTrader. I need some automated way to shutting down cTrader everyday 1 hour before the close of the markets when the spread becomes really high.
Is there a way to do it?
Thanks in advance.
Replies
PanagiotisCharalampous
02 May 2024, 07:13
RE: Can cBot shutdown cTrader
driftingprogrammer said:
Hi,
I was able to use the API
System.Environment.Exit(0);
to shutdown ctrader in the earlier versions of ctrader, but in the new version 4.8, using this API is only shutting down the cBot but not the entire cTrader.
My requirement is to shutdown the entire instance of cTrader. Is there an API I could use in version 4.8 of ctrader to accomplish this.
Please let me know,
Thanks in advance.
cBots now run in separate processes. If you want to close cTrader, you need to find the process and kill it
https://stackoverflow.com/questions/6046916/how-to-close-another-process-from-c-sharp
@PanagiotisCharalampous
driftingprogrammer
02 May 2024, 07:46
( Updated at: 02 May 2024, 10:25 )
RE: RE: Can cBot shutdown cTrader
PanagiotisCharalampous said:
driftingprogrammer said:
Hi,
I was able to use the API
System.Environment.Exit(0);
to shutdown ctrader in the earlier versions of ctrader, but in the new version 4.8, using this API is only shutting down the cBot but not the entire cTrader.
My requirement is to shutdown the entire instance of cTrader. Is there an API I could use in version 4.8 of ctrader to accomplish this.
Please let me know,
Thanks in advance.
cBots now run in separate processes. If you want to close cTrader, you need to find the process and kill it
https://stackoverflow.com/questions/6046916/how-to-close-another-process-from-c-sharp
Thanks for your response,
Can you please guide me how can I identify the parent process. I have 3 profiles of ctrader running on the machine and each profile is running 20 to 100 instances of cBot.
Thanks.
@driftingprogrammer
PanagiotisCharalampous
02 May 2024, 10:31
Hi there,
I do not have an easy solution for you, also forcing the entire application to shut down does not sound like a very elegant solution. What is the exact problem you are trying to solve here?
Best regards,
Panagiotis
@PanagiotisCharalampous
driftingprogrammer
02 May 2024, 17:21
RE: Can cBot shutdown cTrader
PanagiotisCharalampous said:
Hi there,
I do not have an easy solution for you, also forcing the entire application to shut down does not sound like a very elegant solution. What is the exact problem you are trying to solve here?
Best regards,
Panagiotis
Thanks for your response.
Trendpilot performs very poorly when the spread increases so i want to shutdown ctrader 2 hours before close of day and start ctrader 2 hours after the start of market.
I dont want to close trades before end of the day, i just want to shutdown all the 28 instances of cbot for 4 hours and since trendpilot is a third party cbot the only way i can shut them down automatically, all the 28 instances, is by shutting down ctrader.
So my custom cbot was shutting down ctrader after midnight using the API mentioned earlier.
Thanks.
@driftingprogrammer
driftingprogrammer
22 May 2024, 10:06
RE: RE: Can cBot shutdown cTrader
driftingprogrammer said:
PanagiotisCharalampous said:
Hi there,
I do not have an easy solution for you, also forcing the entire application to shut down does not sound like a very elegant solution. What is the exact problem you are trying to solve here?
Best regards,
Panagiotis
Thanks for your response.
Trendpilot performs very poorly when the spread increases so i want to shutdown ctrader 2 hours before close of day and start ctrader 2 hours after the start of market.
I dont want to close trades before end of the day, i just want to shutdown all the 28 instances of cbot for 4 hours and since trendpilot is a third party cbot the only way i can shut them down automatically, all the 28 instances, is by shutting down ctrader.
So my custom cbot was shutting down ctrader after midnight using the API mentioned earlier.
Thanks.
Hi Panagiotis,
In order to solve the problem mentioned here I understand that the new API which allows my custom cBot to start stop the purchased cBot will be the most awesome solution.
Can you please share details of this new API.
Thanks in advance,
Vipin.
@driftingprogrammer
driftingprogrammer
01 May 2024, 14:34 ( Updated at: 02 May 2024, 07:04 )
Hi,
I was able to use the API
System.Environment.Exit(0);
to shutdown ctrader in the earlier versions of ctrader, but in the new version 4.8, using this API is only shutting down the cBot but not the entire cTrader.
My requirement is to shutdown the entire instance of cTrader. Is there an API I could use in version 4.8 of ctrader to accomplish this.
Please let me know,
Thanks in advance.
@driftingprogrammer