合约跟单/一键跟单/现货合约跟单对接API交易所系统开发项目详细/策略说明/案例源码
量化交易机器人是什么?
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();