Launching cAlgo or cTrader as a Windows Service
Launching cAlgo or cTrader as a Windows Service
02 Jan 2015, 15:11
Hi,
Is it possible to launch cAlgo from as a Windows Service or from a Console Application? I cannot seem to Add Reference in Visual Studio. If so, what is the C# code for that?
Thanks in advance.
Scott
Replies
sho@fxbi.org
07 Jan 2015, 01:34
RE: RE:
Hi OldDirtyPipster,
I am developing an standalone server-side exe (Windows service) that calls the cAlgo dll. Because of the trading strategy I use, the logic CANNOT reside in any specific cAlgo. Though this windows service and cAlgo would have to live on the same machine. Why? Most people develop their Robots and trade only one one data feed, the one from your broker. However, your feed may not have all the instruments you want to monitor or trade. For example, how many MT4 or cTrader brokers are giving you Dollar Index? Most people are assumed to trade with a single broker as your broker would hope. This model never allows you to shop for the best quote. When you have two quotes you immediately have a comparison. No matter how many brokers you receive your data feed from, if you are a retail FX trader there is only ONE best quote and that's the one closest to the ECN (e.g., Currenex or through their prime broker's FIX API) that your broker subscribes to BEFORE relaying to your cTrader/cAlgo. Depending on your broker's commission structure, you may never get that nor can you verify it (until one day you are profitable and professional enough to have a subscription to Currenex yourself). As you know FX is not exchange traded, OTC has one major drawback in that your strategy is only as good as your broker's market data feed. So tell me, if you have $100,000 equity, would you use two brokers ($50,000 per broker) or let one broker have all your money?
olddirtypipster said:
You want to start the cTrader.exe via a windows service c? May I ask why?
Regardless, If you wish todo so, you might want to look into the CreateProcess Win32 API call. You can use this in managed C# code via [DllImport("kernel32.dll")]
I truly fail to see why you would ever want to do this, however. It's got that bad code smell to me, man...
sho@fxbi.org said:
Hi,
Is it possible to launch cAlgo from as a Windows Service or from a Console Application? I cannot seem to Add Reference in Visual Studio. If so, what is the C# code for that?
Thanks in advance.
Scott
@sho@fxbi.org
Spotware
08 Jan 2015, 10:34
It is not possible to run cAlgo as a Windows Service. It is also not possible to run cAlgo as a Console Application. If you want to develop your trading system outside of cAlgo you can write a cBot that streams prices from cAlgo. You can also use Spotware Open API. If you have any question regarding Open API please contact connect@spotware.com.
@Spotware
olddirtypipster
06 Jan 2015, 23:21
RE:
You want to start the cTrader.exe via a windows service c? May I ask why?
Regardless, If you wish todo so, you might want to look into the CreateProcess Win32 API call. You can use this in managed C# code via [DllImport("kernel32.dll")]
I truly fail to see why you would ever want to do this, however. It's got that bad code smell to me, man...
sho@fxbi.org said:
@olddirtypipster