量化的关键在于策略家预先建立的策略信号。比如有人用macd金叉作为进场信号,其实就是简单的量化;macd处理了一些基本的K线数据,然后画出来,就是量化,After processing the data with the golden cross structure on the chart,you choose to enter the market,which is quantitative trading.量化交易不是高频交易,每个指标其实都是一种量化,每个量化交易者都在创造一个新的指标;通过你理解的算法组合数据,用电脑计算,形成自己的交易系统,这就是真正的量化交易
量化交易两层含义:
一是从狭义上来讲,是指量化交易的内容,将交易条件转变成为程序,自动下单;
二是从广义上来讲,是指系统交易方法,就是一个整合的交易系统。Based on a series of trading conditions,an intelligent decision-making system is developed to combine rich professional experience with trading conditions and manage risk control during the trading process.
int PFLD::Impl::ExtractKeypoints(const cv::Mat&img_face,std::vector<cv::Point2f>*keypoints){
std::cout<<"start extract keypoints."<<std::endl;
keypoints->clear();
if(!initialized_){
std::cout<<"model uninitialed."<<std::endl;
return 10000;
}
if(img_face.empty()){
std::cout<<"input empty."<<std::endl;
return 10001;
}
//image prepocess
cv::Mat face_cpy=img_face.clone();
int width=face_cpy.cols;
int height=face_cpy.rows;
float scale_x=staticcast<float>(width)/inputSize;
float scale_y=staticcast<float>(height)/inputSize;
cv::Mat face_resized;
cv::resize(face_cpy,faceresized,cv::Size(inputSize,inputSize_));
face_resized.convertTo(face_resized,CV_32FC3);
face_resized=(face_resized-123.0f)/58.0f;
auto tensor_data=inputtensor->host<float>();
auto tensor_size=inputtensor->size();
::memcpy(tensor_data,face_resized.data,tensor_size);
auto inputtensor=landmarker->getSessionInput(session_,nullptr);
input_tensor->copyFromHostTensor(inputtensor);
landmarker->runSession(session);
//get output
std::string output_tensor_name0="conv5_fwd";
MNN::Tensor*tensorlandmarks=landmarker->getSessionOutput(session_,output_tensor_name0.c_str());
MNN::Tensor tensor_landmarks_host(tensor_landmarks,tensor_landmarks->getDimensionType());
tensor_landmarks->copyToHostTensor(&tensor_landmarks_host);
std::cout<<"batch:"<<tensor_landmarks->batch()<<std::endl
<<"channels:"<<tensor_landmarks->channel()<<std::endl
<<"height:"<<tensor_landmarks->height()<<std::endl
<<"width:"<<tensor_landmarks->width()<<std::endl
<<"type:"<<tensor_landmarks->getDimensionType()<<std::endl;
auto landmarks_dataPtr=tensor_landmarks_host.host<float>();
int num_of_points=98;
for(int i=0;i<num_of_points;++i){
cv::Point2f curr_pt(landmarks_dataPtr[2i+0]scale_x,
landmarks_dataPtr[2i+1]scale_y);
keypoints->push_back(curr_pt);
}
std::cout<<"end extract keypoints."<<std::endl;
return 0;
}