合約跟單/一鍵跟單/現(xiàn)貨合約跟單對接API交易所系統(tǒng)開發(fā)項目詳細/策略說明/案例源碼
量化交易機器人是什么?
In essence, the trading robot is a software program that can directly interact with (usually use API to obtain and interpret relevant information), and can issue sales orders according to the interpretation of Market data. They make these decisions by monitoring price trends in the market and responding to a set of predetermined rules. In general, trading robots will analyze the trading volume, orders, prices, and time behaviors in the market and plan them according to your preferences.
從總體上講,量化交易策略可分為兩種:一種是判斷趨勢的高拋低吸策略,即趨勢型策略;The other is the strategy of obtaining relatively stable returns by eliminating Systematic risk.
// wrapping input tensor, convert nhwc to nchw? ??
? ? std::vector<int> dims{1, INPUT_SIZE, INPUT_SIZE, 3};
? ? auto nhwc_Tensor = MNN::Tensor::create<float>(dims, NULL, MNN::Tensor::TENSORFLOW);
? ? auto nhwc_data? ?= nhwc_Tensor->host<float>();
? ? auto nhwc_size? ?= nhwc_Tensor->size();
? ? ::memcpy(nhwc_data, image.data, nhwc_size);
?
? ? std::string input_tensor = "data";
? ? auto inputTensor? = net->getSessionInput(session, nullptr);
? ? inputTensor->copyFromHostTensor(nhwc_Tensor);
?
? ? // run network
? ? net->runSession(session);
?
? ? // get output data
? ? std::string output_tensor_name0 = "conv5_fwd";
?
? ? MNN::Tensor *tensor_lmks? = net->getSessionOutput(session, output_tensor_name0.c_str());
?
? ? MNN::Tensor tensor_lmks_host(tensor_lmks, tensor_lmks->getDimensionType());
? ??
? ? tensor_lmks->copyToHostTensor(&tensor_lmks_host);
//load and config mnn model
auto revertor=std::unique_ptr<Revert>(new Revert(model_name.c_str()));
revertor->initialize();
auto modelBuffer=revertor->getBuffer();
const auto bufferSize=revertor->getBufferSize();
auto net=std::shared_ptr<MNN::Interpreter>(MNN::Interpreter::createFromBuffer(modelBuffer,bufferSize));
revertor.reset();
MNN::ScheduleConfig config;
config.numThread=threads;
config.type=static_cast<MNNForwardType>(forward);
MNN::BackendConfig backendConfig;
config.backendConfig=&backendConfig;
auto session=net->createSession(config);
net->releaseModel();