量化交易(做市)机器人是一种软件程序,它通常使用API获取和解释相关信息,并根据市场数据的解释代表用户发出买麦订单。这些机器人通过监测市场价格走势,并根据一套预先设定和编程的规则作出反应,从而做出这些决定。
The two main uses of quantitative trading robots are to set up market forces;When the market is relatively cold,act as a corresponding seller or buyer,and activate trading volume in the market;After initializing the setting parameters,the quantitative trading robot will trade according to the strategy,automatically buying or selling when the set conditions are met,without having to wait for a long time;Strictly implement trading strategies based on the new market situation;View transaction conditions in real time to ensure the timeliness of transaction execution;Avoid adverse effects caused by human subjective factors as much as possible
合约量化交易机器人:
1、交易机器人直接与交易所进行交互,并根据对市场数据的解释代表用户进行买麦交易;其跟踪市场价格变动,并根据预定义和预编程的规则作出反应;
2、交易机器人在一个加密coin交易所进行交易,以较低的价格买入coin,再以较高的价格卖出,从而获得收入。
3、交易机器人会自动且不断地发出限价单,To profit from price differentials;
The contract tracking system utilizes big data analysis capabilities.The platform creates corresponding transaction ranking lists based on various data such as transaction volume and transaction volume.Novice players can select the objects they want to track based on these reference suggestions provided by the platform,and the system will automatically conduct tracking operations.
dataloader=load_calibration_dataset(
directory=WORKING_DIRECTORY,
input_shape=NETWORK_INPUTSHAPE,
batchsize=CALIBRATION_BATCHSIZE,
input_format=INPUT_LAYOUT)
print('网络正量化中,根据你的量化配置,这将需要一段时间:')
quantized=quantize(
working_directory=WORKING_DIRECTORY,setting=SETTING,
model_type=MODEL_TYPE,executing_device=EXECUTING_DEVICE,
input_shape=NETWORK_INPUTSHAPE,target_platform=TARGET_PLATFORM,
dataloader=dataloader,calib_steps=32)
#如果你需要执行量化后的神经网络并得到结果,则需要创建一个executor
#这个executor的行为和torch.Module是类似的,你可以利用这个东西来获取执行结果
#请注意必须在executor之前执行此操作
executor=TorchExecutor(graph=quantized)
#output=executor.forword(input)
#导出PPQ执行网络的所有中间结果,该功能是为了和硬件对比结果
#中间结果可能十分庞大,因此PPQ将使用线性同余发射器从执行结果中采样
#对了对比中间结果,硬件执行结果也必须使用同样的随机数种子采样
#查阅ppq.util.fetch中的相关代码以进一步了解此内容
#查阅ppq.api.fsys中的dump_internal_results函数以确定采样逻辑
if DUMP_RESULT:
dump_internal_results(
graph=quantized,dataloader=dataloader,
dump_dir=WORKING_DIRECTORY,executing_device=EXECUTING_DEVICE)
#PPQ计算量化误差时,使用信噪比的倒数作为指标,即噪声能量/信号能量
#量化误差0.1表示在整体信号中,量化噪声的能量约为10%
#你应当注意,在graphwise_error_analyse分析中,我们衡量的是累计误差
#网络的最后一层往往都具有较大的累计误差,这些误差是其前面的所有层所共同造成的
#你需要使用layerwise_error_analyse逐层分析误差的来源
#-------------------------------------------------------------------
print('正计算网络量化误差(SNR),最后一层的误差应小于0.1以保证量化精度:')
reports=graphwise_error_analyse(
graph=quantized,running_device=EXECUTING_DEVICE,steps=32,
dataloader=dataloader,collate_fn=lambda x:x.to(EXECUTING_DEVICE))
for op,snr in reports.items():
if snr>0.1:ppq_warning(f'层{op}的累计量化误差显著,请考虑进行优化')
if REQUIRE_ANALYSE:
print('正计算逐层量化误差(SNR),每一层的独立量化误差应小于0.1以保证量化精度:')
layerwise_error_analyse(graph=quantized,running_device=EXECUTING_DEVICE,
interested_outputs=None,
dataloader=dataloader,collate_fn=lambda x:x.to(EXECUTING_DEVICE))