Reprint needs to indicate: Http://blog.csdn.net/minimicall, http://cloudtrade.top/
Analysis Cointrader has a certain level, found that it is not a product after all, has not been verified. In terms of architecture, coding and so on are very non-standard.
Want to write a cloud trading platform, the way and heavy. We need to refer to some mature architectures.
Quantopian zipline not, because I just see it can't, so just to analyze Cointrader.
Now these two, one is not the cloud platform at all, one is immature, so I can only analyze the remaining one quantconnect. Its engine is lean.
Learning lean starts with learning, then learns its architecture and source code. Then we design our architecture and platform.
Let's first look at an example. The most basic case of the official.
The code is as follows:
namespace quantconnect {/* * Quantconnect university:full Basic Template: * * The underlying QCALGORITHM class is full of helper methods which enable your to use Quantconnect. * We have explained some of these here, but the full algorithm can is found at: * Https://github.com/QuantConnect/Q Calgorithm/blob/master/quantconnect.algorithm/qcalgorithm.cs */public class Basictemplatealgorithm:qcalgorithm {//initialize The data and resolution require for your strategy
public override void Initialize () {//start and End Date range for the Backtest:sets Tartdate (2013, 1, 1); Setenddate (DateTime.Now.Date.AddDays (-1)); Cash allocation Setcash (25000); Add as many securities as. All the data would be passed into the event handler:addsecurity (securitytype.equity, "SPY", Resolution.minute); }//data Event Handler:new Data arrives here. "Tradebars" type is a dictionary of strings so you can access it by symbol. public void OnData (Tradebars data) {//' Tradebars ' object holds many "Tradebar" Objects:it is a di Ctionary indexed by the symbol:////e.g. data["MSFT"] data["GOOG"] if (! Portfolio.holdstock) {int quantity = (int) math.floor (portfolio.cash/data["SPY"]. Close); ORder function places trades:enter the string symbol and the quantity you Want:order ("SPY", quantity); Debug sends messages to the user console: ' Time ' is the algorithm time keeper object Debug ("Purchased SPY on" + time.toshortdatestring ()); You can also use log to send longer messages to a file. You were capped to 10kb//log ("This is a longer message, send to Log."); } } }}
Programmer's Path to quantitative trading (--quantconnect) Case 1