量化交易(量化合约)机器人系统开发(开发策略及规则)
什么是量化交易机器人?从本质上来说,量化交易机器人是一个软件程序,它直接与金融交易所交互,并根据市场数据的解释代表你发出买卖指令 这些机器人通过监控市场价格趋势并根据一套预设和程序化的规则做出反应来做出这些决定 通常,交易机器人会分析市场行为,比如交易量、订单、价格和时间,这些通常可以根据您自己的偏好进行编程 class Calibration{ public: //参数原始模型,模型uint8_t buffer,size,json配置文件 Calibration(MNN::NetT*model,uint8_t*modelBuffer,const int bufferSize,const std::string&configPath); void runQuantizeModel(); private:开发功能及模式I35需求7O98开发O7I8 Calibration(); MNN::NetT*_originaleModel;//需要量化的模型 std::shared_ptr<MNN::CV::ImageProcess>_process;//负责image到tensor的转化类 const int _binNums=2048; int _imageNum=0; int _width;详细及源码:MrsFu123 int _height; std::vector<std::string>_imgaes;//图片,用于校正特征量化系数的 //Tensor and Info //tensor到对应的TensorStatistic,TensorStatistic是描述tensor在量化过程中需要的统计数据,后面有解释 std::map<const MNN::Tensor*,std::shared_ptr<TensorStatistic>>_featureInfo; //所有的tensor std::map<int,const MNN::Tensor*>_tensorMap; //Op's name,Inputs,Outputs //op到input/output tensor的映射 std::map<std::string,std::pair<std::vector<MNN::Tensor*>,std::vector<MNN::Tensor*>>>_opInfo; //The scale results std::map<const MNN::Tensor*,std::vector<float>>_scales; std::shared_ptr<MNN::Interpreter>_interpreter; //keep mnn forward information MNN::Session*_session; MNN::Tensor*_inputTensor; std::vector<int>_inputTensorDims; std::string _featureQuantizeMethod="KL"; std::string _weightQuantizeMethod="MAX_ABS"; void _initMNNSession(const uint8_t*modelBuffer,const int bufferSize,const int channels); void _initMaps(); void _computeFeatureMapsRange(); void _collectFeatureMapsDistribution(); void _computeFeatureScaleKL(); void _computeFeatureScaleADMM(); void _updateScale(); //insert the dequantization op before the not supported op(int8),and insert dequantization op //after the output op,so that get original float data conveniently void _insertDequantize(); }; #endif//CALIBRATION_HPP