量化交易是什么?
1、从交易端来讲:量化交易是指交易的内容,将交易条件通过python或VB转变成为程序语言,通过条件指令使交易终端按照设定的条件自动下单交易;
2、从量化交易的含义来讲:量化交易是指系统交易方法,就是一个整合的交易系统。
int WtHftStraDemo::__tqz_resetToHourMinute(int toHourMinute,const int offsetCloseMinutes=0){
int toMinute=toHourMinute%100;
int toHour=toHourMinute/100;
int offsetMinutes=offsetCloseMinutes%60;
int offsetHours=offsetCloseMinutes/60;
int newMinute=60+toMinute;//reset minutes
int newHour=(toHour-(offsetHours%24+1)+24)%24;//reset hours
if(toMinute-offsetMinutes<0||offsetHours!=0)//reset toHourMinute or not
toHourMinute=newHour*100+newMinute;
return toHourMinute;
}
std::string WtHftStraDemo::__tqz_getLogFileName(const TQZLogFileType logfileType){
switch(logfileType){
case TRADE_CHANGE_TYPE:
return"hft_tradeChange_"+to_string(this->_ctx->tqz_getTradingDate());
case CANCEL_ORDER_COUNTS_TYPE:
return"hft_cancelOrderCounts_"+to_string(this->_ctx->tqz_getTradingDate());
default:
return"";
}
}
std::string WtHftStraDemo::__tqz_getCurrentTime(){
const boost::posix_time::ptime now=boost::posix_time::microsec_clock::local_time();
const boost::posix_time::time_duration timeOfDay=now.time_of_day();
const uint64_t hours=timeOfDay.hours();
const uint64_t minutes=timeOfDay.minutes();
const uint64_t seconds=timeOfDay.seconds();
const uint64_t milliseconds=timeOfDay.total_milliseconds()-(hours3600+minutes60+seconds)*1000;
return this->__tqz_getTimeString(hours,minutes,seconds,milliseconds);
}
std::string WtHftStraDemo::__tqz_getCurrentMarketTime(){
uint32_t time=this->_ctx->stra_get_time();
uint32_t secs=this->_ctx->stra_get_secs();
int hours=time/100;
int minutes=time%100;
int seconds=secs/1000;