📜  如何解决 HiLo 中的 CopyBuffer 失败,没有数据 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:57.533000             🧑  作者: Mango

代码示例1
//---------------- Middle MA
if(CopyBuffer(ExtMiddleHandle, 0, startFromIndex, bufferSize, ExtMiddleBuffer) < 2)  
  {  
   Print("Loading ExtMiddleHandle failed ", GetLastError());
  }  
ENUM_ORDER_TYPE middleDir = ExtMiddleBuffer[0] == ExtMiddleBuffer[1] ? NULL : (ExtMiddleBuffer[0] < ExtMiddleBuffer[1] ? ORDER_TYPE_BUY : ORDER_TYPE_SELL);

//---------------- Slow MA  
if(CopyBuffer(ExtSlowHandle, 0, startFromIndex, bufferSize, ExtSlowBuffer) < 2)  
  {  
   Print("Loading ExtSlowHandle failed ", GetLastError());
  }  
ENUM_ORDER_TYPE slowDir = ExtSlowBuffer[0] == ExtSlowBuffer[1] ? NULL : (ExtSlowBuffer[0] < ExtSlowBuffer[1] ? ORDER_TYPE_BUY : ORDER_TYPE_SELL);