50 RMB求改飞狐DLL公式
以下为我的DLL CPP源码__declspec(dllexport) int WINAPI MMXH(CALCINFO* pData)
{
if ( pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 &&
pData->m_pCalcParam.m_nParamStart >= 0 )
{
int nFirst = pData->m_pCalcParam.m_nParamStart;
const float* pValue1 = pData->m_pCalcParam.m_pfParam;
const float* pValue2 = pData->m_pCalcParam.m_pfParam;
const float* pValue3 = pData->m_pCalcParam.m_pfParam;
const float* pValue4 = pData->m_pCalcParam.m_pfParam;
const float* pValue5 = pData->m_pCalcParam.m_pfParam;
const float* pValue6 = pData->m_pCalcParam.m_pfParam;
const float* pValue7 = pData->m_pCalcParam.m_pfParam;
const float* pValue8 = pData->m_pCalcParam.m_pfParam;
const float* pValue9 = pData->m_pCalcParam.m_pfParam;
const float* pValue10 = pData->m_pCalcParam.m_pfParam;
const float* pValue11 = pData->m_pCalcParam.m_pfParam;
const float* pValue12 = pData->m_pCalcParam.m_pfParam;
const float* pValue13 = pData->m_pCalcParam.m_pfParam;
const float* pValue14 = pData->m_pCalcParam.m_pfParam;
const float* pValue15 = pData->m_pCalcParam.m_pfParam;
const float* pValue16 = pData->m_pCalcParam.m_pfParam;
for( int i = pData->m_nNumData-240; i < pData->m_nNumData; i++ )
{
if(i==pData->m_nNumData-1) {
float a[] = {pValue1,pValue2,pValue3,pValue4,pValue5,pValue6,pValue7,pValue8};
float b[] = {pValue9,pValue10,pValue11,pValue12,pValue13,pValue14,pValue15,pValue16};
int qq = 0,ss = 0;
for (int pp = 0 ; pp <7; pp++)
{ if(a>0 )
{qq = pp+1;
if(qq<5 )
{ time_t rawtime;
time ( &rawtime );
ofstream kd;
kd.open("signal.txt",ios::app);
kd <<"buyqq"<<qq<<""<<i<<""<<ctime(&rawtime);
kd.close();
}if(qq>4 )
{ time_t rawtime;
time ( &rawtime );
ofstream kkd;
kkd.open("signal.txt",ios::app);
kkd <<"sell qq"<<qq<<""<<i<<""<<ctime(&rawtime);
kkd.close();
}
}
}
for (int tt = 0 ; tt <7; tt++)
{ if(b>0 )
{ss= tt+1;
time_t rawtime;
time ( &rawtime );
ofstream pc;
pc.open("signal.txt",ios::app);
pc <<"pc ss"<<ss<<""<<i<<""<<ctime(&rawtime);
pc.close();
}
}
}
pData->m_pResultBuf = i;
}
return nFirst;
}
return -1;
}
共8 个买卖信号,加上相对应平仓信号 共16个
我用两个数组来处理
数组a为8个买卖信号 b为8个买卖信号对应的平仓信号
现在的状况是
a中信号在1分钟中因分笔数据刷新而重复 出现
如下面的信号
sell qq62751Fri Jan 13 10:06:01 2012
sell qq62751Fri Jan 13 10:06:02 2012
sell qq62751Fri Jan 13 10:06:03 2012
sell qq62751Fri Jan 13 10:06:03 2012
sell qq62751Fri Jan 13 10:06:04 2012
sell qq62751Fri Jan 13 10:06:04 2012
sell qq62751Fri Jan 13 10:06:05 2012
sell qq62751Fri Jan 13 10:06:05 2012
sell qq62751Fri Jan 13 10:06:06 2012
sell qq62751Fri Jan 13 10:06:06 2012
sell qq62751Fri Jan 13 10:06:07 2012
sell qq62751Fri Jan 13 10:06:07 2012
sell qq62751Fri Jan 13 10:06:08 2012
sell qq62751Fri Jan 13 10:06:08 2012
sell qq62751Fri Jan 13 10:06:09 2012
sell qq62751Fri Jan 13 10:06:09 2012
sell qq62751Fri Jan 13 10:06:10 2012
sell qq62751Fri Jan 13 10:06:10 2012
sell qq62751Fri Jan 13 10:06:11 2012
sell qq62751Fri Jan 13 10:06:11 2012
sell qq62751Fri Jan 13 10:06:12 2012
sell qq62751Fri Jan 13 10:06:12 2012
sell qq62751Fri Jan 13 10:06:13 2012
sell qq62751Fri Jan 13 10:06:13 2012
sell qq62751Fri Jan 13 10:06:14 2012
sell qq62751Fri Jan 13 10:06:14 2012
sell qq62751Fri Jan 13 10:06:15 2012
sell qq62751Fri Jan 13 10:06:15 2012
sell qq62751Fri Jan 13 10:06:16 2012
sell qq62751Fri Jan 13 10:06:16 2012
sell qq62751Fri Jan 13 10:06:17 2012
sell qq62751Fri Jan 13 10:06:18 2012
sell qq62751Fri Jan 13 10:06:18 2012
sell qq62751Fri Jan 13 10:06:19 2012
sell qq62751Fri Jan 13 10:06:19 2012
sell qq62751Fri Jan 13 10:06:20 2012
sell qq62751Fri Jan 13 10:06:20 2012
sell qq62751Fri Jan 13 10:06:21 2012
sell qq62751Fri Jan 13 10:06:21 2012
sell qq62751Fri Jan 13 10:06:22 2012
sell qq62751Fri Jan 13 10:06:22 2012
sell qq62751Fri Jan 13 10:06:23 2012
sell qq62751Fri Jan 13 10:06:23 2012
sell qq62751Fri Jan 13 10:06:24 2012
sell qq62751Fri Jan 13 10:06:24 2012
sell qq62751Fri Jan 13 10:06:25 2012
sell qq62751Fri Jan 13 10:06:25 2012
sell qq62751Fri Jan 13 10:06:26 2012
sell qq62751Fri Jan 13 10:06:26 2012
sell qq62751Fri Jan 13 10:06:27 2012
sell qq62751Fri Jan 13 10:06:27 2012
sell qq62751Fri Jan 13 10:06:28 2012
sell qq62751Fri Jan 13 10:06:28 2012
sell qq62751Fri Jan 13 10:06:29 2012
sell qq62751Fri Jan 13 10:06:29 2012
sell qq62751Fri Jan 13 10:06:30 2012
sell qq62751Fri Jan 13 10:06:30 2012
sell qq62751Fri Jan 13 10:06:31 2012
sell qq62751Fri Jan 13 10:06:31 2012
sell qq62751Fri Jan 13 10:06:32 2012
sell qq62751Fri Jan 13 10:06:32 2012
sell qq62751Fri Jan 13 10:06:33 2012
sell qq62751Fri Jan 13 10:06:33 2012
sell qq62751Fri Jan 13 10:06:34 2012
sell qq62751Fri Jan 13 10:06:34 2012
sell qq62751Fri Jan 13 10:06:35 2012
sell qq62751Fri Jan 13 10:06:36 2012
sell qq62751Fri Jan 13 10:06:36 2012
sell qq62751Fri Jan 13 10:06:37 2012
sell qq62751Fri Jan 13 10:06:37 2012
sell qq62751Fri Jan 13 10:06:38 2012
sell qq62751Fri Jan 13 10:06:38 2012
sell qq62751Fri Jan 13 10:06:39 2012
sell qq62751Fri Jan 13 10:06:39 2012
sell qq62751Fri Jan 13 10:06:40 2012
sell qq62751Fri Jan 13 10:06:40 2012
sell qq62751Fri Jan 13 10:06:41 2012
sell qq62751Fri Jan 13 10:06:41 2012
sell qq62751Fri Jan 13 10:06:42 2012
sell qq62751Fri Jan 13 10:06:42 2012
sell qq62751Fri Jan 13 10:06:43 2012
sell qq62751Fri Jan 13 10:06:43 2012
sell qq62751Fri Jan 13 10:06:44 2012
sell qq62751Fri Jan 13 10:06:44 2012
sell qq62751Fri Jan 13 10:06:45 2012
sell qq62751Fri Jan 13 10:06:46 2012
sell qq62751Fri Jan 13 10:06:46 2012
sell qq62751Fri Jan 13 10:06:47 2012
sell qq62751Fri Jan 13 10:06:47 2012
sell qq62751Fri Jan 13 10:06:48 2012
sell qq62751Fri Jan 13 10:06:48 2012
sell qq62751Fri Jan 13 10:06:49 2012
sell qq62751Fri Jan 13 10:06:49 2012
sell qq62751Fri Jan 13 10:06:50 2012
sell qq62751Fri Jan 13 10:06:50 2012
sell qq62751Fri Jan 13 10:06:51 2012
sell qq62751Fri Jan 13 10:06:51 2012
sell qq62751Fri Jan 13 10:06:52 2012
sell qq62751Fri Jan 13 10:06:52 2012
sell qq62751Fri Jan 13 10:06:53 2012
sell qq62751Fri Jan 13 10:06:53 2012
sell qq62751Fri Jan 13 10:06:54 2012
sell qq62751Fri Jan 13 10:06:54 2012
sell qq62751Fri Jan 13 10:06:55 2012
sell qq62751Fri Jan 13 10:06:55 2012
sell qq62751Fri Jan 13 10:06:56 2012
sell qq62751Fri Jan 13 10:06:56 2012
sell qq62751Fri Jan 13 10:06:57 2012
sell qq62751Fri Jan 13 10:06:57 2012
sell qq62751Fri Jan 13 10:06:58 2012
sell qq62751Fri Jan 13 10:06:58 2012
sell qq62751Fri Jan 13 10:06:59 2012
sell qq62751Fri Jan 13 10:06:59 2012
sell qq62751Fri Jan 13 10:07:00 2012
sell qq62751Fri Jan 13 10:07:00 2012
sell qq62751Fri Jan 13 10:07:01 2012
sell qq62751Fri Jan 13 10:07:01 2012
sell qq62752Fri Jan 13 10:07:02 2012
sell qq62752Fri Jan 13 10:07:02 2012
sell qq62752Fri Jan 13 10:07:03 2012
现在要求
1:只能在一分钟出现一次 并且是第一次出现那个信号
2:b中的平仓的要求是a中的最后一个信号所对应的才能出现也是 只能在一分钟出现一次 并且是第一次出现那个信号
3:以上1,2要求的信号写入TXT文件(如上面CPP中所示)
4:在处理1分钟过滤信号时不能频繁读写TXT文件(这个我已作过 效率太差 CPU使用过高)
附飞狐DLL公式接口规范 有朋友愿帮忙的请联系
QQ 1284857154 雷锋精神传天下!谢谢分享! 看一看,谢谢
页:
[1]