索引
1、在屏幕上顯示文字標簽
void iDisplayInfo(string LableName,string LableDoc,int Corner,int LableX,int LableY,int DocSize,string DocStyle,color DocColor);
2、金額轉換手數
double iFundsToHands(string mySymbol,double myFunds);
3、訂單淨值轉換點數
int iOrderEquitToPoint(int myTicket);
4、顯示錯誤信息
string iGetErrorInfo(int myErrorNum);
5、交易繁忙,程序等待,更新緩存數據
void iWait(int myDelayTime);
6、有效時間段
bool iValidTime(string myStartTime,string myEndTime,bool myServerTime);
7、計算特定條件的訂單
int iOrdersSort(int myOrderType,int myOrderSort,int myMaxMin,int myMagicNum);
8、持倉單數量統計
int iOrderStatistics(int myOrderType,int myMagicNum);
9、物件顏色
color iObjectColor(double myInput);
10、持倉單開倉量總計
int iGroupLots(int myOrderType,int myMagicNum);
11、持倉單淨值總計
double iGroupEquity(int myOrderType,int myMagicNum);
12、開倉量整形
double iLotsFormat(double myLots);
13、批量清倉
void iBatchClose(int myType,double myLots,int myMagicNum);
14、標注符號和畫線、文字
void iDrawSign(string myType,int myBarPos,double myPrice,color myColor,int mySymbol,string myString,int myDocSize);
15、時間周期轉換字符
string iTimeFrameToString(int myTimeFrame);
16、文件操作
void iFileOperation(string myFileName,string myString,int myFileType,int myFileMode);
void iFileOperation(string myFileName,int myFileType,int myFileMode,string myFileString)
{
int myHandle; //文件序列號
if (myFileMode==0 && myFileString=="") //新建文件
{
if (myFileType==0) myHandle=FileOpen(myFileName,FILE_BIN|FILE_WRITE);
if (myFileType==1) myHandle=FileOpen(myFileName,FILE_CSV|FILE_WRITE,";");
FileClose(myHandle);
}
if (myFileMode==1 && myFileString!="") //創建寫入字符串
{
if (myFileType==0) myHandle=FileOpen(myFileName,FILE_BIN|FILE_WRITE);
if (myFileType==1) myHandle=FileOpen(myFileName,FILE_CSV|FILE_WRITE,";");
FileWrite(myHandle,myFileString);
FileClose(myHandle);
}
if (myFileMode==2 && myFileString!="") //追加寫入字符串
{
if (myFileType==0)
{
myHandle=FileOpen(myFileName,FILE_BIN|FILE_READ|FILE_WRITE);
FileSeek(myHandle,0,SEEK_END);
FileWrite(myHandle,myFileString);
FileClose(myHandle);
}
if (myFileType==1)
{
myHandle=FileOpen(myFileName,FILE_CSV|FILE_READ|FILE_WRITE,";");
FileSeek(myHandle,SEEK_SET,SEEK_END);
FileWrite(myHandle,myFileString);
FileClose(myHandle);
}
}
return(0);
}
string iTimeFrameToString(int myTimeFrame)
{
switch(myTimeFrame)
{
case 1:
return("M1");
break;
case 5:
return("M5");
break;
case 15:
return("M15");
break;
case 30:
return("M30");
break;
case 60:
return("H1");
break;
case 240:
return("H4");
break;
case 1440:
return("D1");
break;
case 10080:
return("W1");
break;
case 43200:
return("MN1");
break;
}
}
void iDrawSign(string myType,int myBarPos,double myPrice,color myColor,int mySymbol,string myString,int myDocSize)
{
if (myType=="Text")
{
string TextBarString=myType+Time[myBarPos];
ObjectCreate(TextBarString,OBJ_TEXT,0,Time[myBarPos],myPrice);
ObjectSet(TextBarString,OBJPROP_COLOR,myColor);//顏色
ObjectSet(TextBarString,OBJPROP_FONTSIZE,myDocSize);//大小
ObjectSetText(TextBarString,myString);//文字內容
ObjectSet(TextBarString,OBJPROP_BACK,false);
}
if (myType=="Dot")
{
string DotBarString=myType+Time[myBarPos];
ObjectCreate(DotBarString,OBJ_ARROW,0,Time[myBarPos],myPrice);
ObjectSet(DotBarString,OBJPROP_COLOR,myColor);
ObjectSet(DotBarString,OBJPROP_ARROWCODE,mySymbol);
ObjectSet(DotBarString,OBJPROP_BACK,false);
}
if (myType=="HLine")
{
string HLineBarString=myType+Time[myBarPos];
ObjectCreate(HLineBarString,OBJ_HLINE,0,Time[myBarPos],myPrice);
ObjectSet(HLineBarString,OBJPROP_COLOR,myColor);
ObjectSet(HLineBarString,OBJPROP_BACK,false);
}
if (myType=="VLine")
{
string VLineBarString=myType+Time[myBarPos];
ObjectCreate(VLineBarString,OBJ_VLINE,0,Time[myBarPos],myPrice);
ObjectSet(VLineBarString,OBJPROP_COLOR,myColor);
ObjectSet(VLineBarString,OBJPROP_BACK,false);
}
}
void iBatchClose(int myType,double myLots,int myMagicNum)
{
for (int cnt=0;cnt
{
if (OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES) && OrderMagicNumber()==myMagicNum && OrderSymbol()==Symbol())
{
iWait(1000);
if ((myType==OP_BUY || (myType==9 && OrderType()==OP_BUY)) && (myLots==0 || myLots>OrderLots()))
{
myLots=OrderLots();
OrderClose(OrderTicket(),myLots,Bid,0);
}
if ((myType==OP_SELL || (myType==9 && OrderType()==OP_SELL)) && (myLots==0 || myLots>OrderLots()))
{
myLots=OrderLots();
OrderClose(OrderTicket(),myLots,Ask,0);
}
if (myType==OP_BUYLIMIT || myType==OP_SELLLIMIT || myType==OP_BUYSTOP || myType==OP_SELLSTOP
|| (myType==9 && (OrderType()==OP_BUYLIMIT || OrderType()==OP_SELLLIMIT || OrderType()==OP_BUYSTOP || OrderType()==OP_SELLSTOP)))
{
OrderDelete(OrderTicket());
}
}
}
return(0);
}
double iLotsFormat(double myLots)
{
myLots=MathRound(myLots/MarketInfo(Symbol(), MODE_MINLOT))*MarketInfo(Symbol(), MODE_MINLOT);//開倉量整形
return(myLots);
}
double iGroupEquity(int myOrderType,int myMagicNum)
{
double myReturn;
if (OrdersTotal()==0) return(0);
for (int cnt=0;cnt
{
if (OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)
&& OrderMagicNumber()==myMagicNum && OrderSymbol()==Symbol() && OrderType()==myOrderType)
{
myReturn=myReturn+OrderProfit();
}
}
return(myReturn);
}
double iGroupLots(int myOrderType,int myMagicNum)
{
double myReturn;
if (OrdersTotal()==0) return(0);
for (int cnt=0;cnt
{
if (OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)
&& OrderMagicNumber()==myMagicNum && OrderSymbol()==Symbol() && OrderType()==myOrderType)
{
myReturn=myReturn+OrderLots();
}
}
return(myReturn);
}
color iObjectColor(double myInput)
{
color myColor;
if (myInput > 0)
myColor = Green; //正數顏色為綠色
if (myInput < 0)
myColor = Red; //負數顏色為紅色
if (myInput == 0)
myColor = DarkGray; //0顏色為灰色
return(myColor);
}
int iOrderStatistics(int myOrderType,int myMagicNum)
{
int myReturn;
if (OrdersTotal()==0) return(0);
for (int cnt=0;cnt
{
if (OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)
&& OrderMagicNumber()==myMagicNum && OrderSymbol()==Symbol() && OrderType()==myOrderType)
{
myReturn=myReturn+1;
}
}
return(myReturn);
}
int iOrdersSort(int myOrderType,int myOrderSort,int myMaxMin,int myMagicNum)
{
int myReturn,myArrayRange,cnt,i,j;
if (OrdersTotal()<=0) return(myReturn);
myArrayRange=OrdersTotal();
//持倉訂單基本信息:0訂單號,1開倉時間,2訂單利潤,3訂單類型,4開倉量,5開倉價,
// 6止損價,7止贏價,8訂單特征碼,9訂單傭金,10掉期,11掛單有效日期
double myOrdersArray[][12]; //定義訂單數組,第1維:訂單序號;第2維:訂單信息
ArrayResize(myOrdersArray,myArrayRange); //重新界定訂單數組
ArrayInitialize(myOrdersArray, 0.0); //初始化訂單數組
//訂單數組賦值
for (cnt=0; cnt
{
//選中當前貨幣對相關持倉訂單
if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES) && OrderSymbol()==Symbol() && OrderMagicNumber()==myMagicNum)
{
myOrdersArray[cnt][0]=OrderTicket();//0訂單號
myOrdersArray[cnt][1]=OrderOpenTime();//1開倉時間
myOrdersArray[cnt][2]=OrderProfit();//2訂單利潤
myOrdersArray[cnt][3]=OrderType();//3訂單類型
myOrdersArray[cnt][4]=OrderLots();//4開倉量
myOrdersArray[cnt][5]=OrderOpenPrice();//5開倉價
myOrdersArray[cnt][6]=OrderStopLoss();//6止損價
myOrdersArray[cnt][7]=OrderTakeProfit();//7止贏價
myOrdersArray[cnt][8]=OrderMagicNumber();//8訂單特征碼
myOrdersArray[cnt][9]=OrderCommission();//9訂單傭金
myOrdersArray[cnt][10]=OrderSwap();//10掉期
myOrdersArray[cnt][11]=OrderExpiration();//11掛單有效日期
}
}
double myTempArray[12]; //定義臨時數組
//ArrayResize(myTempArray,myArrayRange); //重新界定臨時數組
ArrayInitialize(myTempArray, 0.0); //初始化臨時數組
//開始按條件排序
//---- 按時間降序排列數組,原始數組重新排序
if (myOrderSort==0)
{
for (i=0;i<=myArrayRange;i++)
{
for (j=myArrayRange;j>i;j--)
{
if (myOrdersArray[j][1]>myOrdersArray[j-1][1])
{
myTempArray[0]=myOrdersArray[j-1][0];
myTempArray[1]=myOrdersArray[j-1][1];
myTempArray[2]=myOrdersArray[j-1][2];
myTempArray[3]=myOrdersArray[j-1][3];
myTempArray[4]=myOrdersArray[j-1][4];
myTempArray[5]=myOrdersArray[j-1][5];
myTempArray[6]=myOrdersArray[j-1][6];
myTempArray[7]=myOrdersArray[j-1][7];
myTempArray[8]=myOrdersArray[j-1][8];
myTempArray[9]=myOrdersArray[j-1][9];
myTempArray[10]=myOrdersArray[j-1][10];
myTempArray[11]=myOrdersArray[j-1][11];
myOrdersArray[j-1][0]=myOrdersArray[j][0];
myOrdersArray[j-1][1]=myOrdersArray[j][1];
myOrdersArray[j-1][2]=myOrdersArray[j][2];
myOrdersArray[j-1][3]=myOrdersArray[j][3];
myOrdersArray[j-1][4]=myOrdersArray[j][4];
myOrdersArray[j-1][5]=myOrdersArray[j][5];
myOrdersArray[j-1][6]=myOrdersArray[j][6];
myOrdersArray[j-1][7]=myOrdersArray[j][7];
myOrdersArray[j-1][8]=myOrdersArray[j][8];
myOrdersArray[j-1][9]=myOrdersArray[j][9];
myOrdersArray[j-1][10]=myOrdersArray[j][10];
myOrdersArray[j-1][11]=myOrdersArray[j][11];
myOrdersArray[j][0]=myTempArray[0];
myOrdersArray[j][1]=myTempArray[1];
myOrdersArray[j][2]=myTempArray[2];
myOrdersArray[j][3]=myTempArray[3];
myOrdersArray[j][4]=myTempArray[4];
myOrdersArray[j][5]=myTempArray[5];
myOrdersArray[j][6]=myTempArray[6];
myOrdersArray[j][7]=myTempArray[7];
myOrdersArray[j][8]=myTempArray[8];
myOrdersArray[j][9]=myTempArray[9];
myOrdersArray[j][10]=myTempArray[10];
myOrdersArray[j][11]=myTempArray[11];
}
}
}
if (myMaxMin==0) //x,0,0
{
for (cnt=myArrayRange;cnt>=0;cnt--)
{
if (myOrdersArray[cnt][0]!=0 && myOrderType==NormalizeDouble(myOrdersArray[cnt][3],0))
{
myReturn=NormalizeDouble(myOrdersArray[cnt][0],0);
break;
}
}
}
if (myMaxMin==1) //x,0,1
{
for (cnt=0;cnt
{
if (myOrdersArray[cnt][0]!=0 && myOrderType==NormalizeDouble(myOrdersArray[cnt][3],0))
{
myReturn=NormalizeDouble(myOrdersArray[cnt][0],0);
break;
}
}
}
}
//---- 按訂單淨值降序排列數組,原始數組重新排序
if (myOrderSort==1 || myOrderSort==2)
{
ArrayInitialize(myTempArray, 0.0); //初始化臨時數組
for (i=0;i<=myArrayRange;i++)
{
for (j=myArrayRange-1;j>i;j--)
{
if (myOrdersArray[j][2]>myOrdersArray[j-1][2])
{
myTempArray[0]=myOrdersArray[j-1][0];
myTempArray[1]=myOrdersArray[j-1][1];
myTempArray[2]=myOrdersArray[j-1][2];
myTempArray[3]=myOrdersArray[j-1][3];
myTempArray[4]=myOrdersArray[j-1][4];
myTempArray[5]=myOrdersArray[j-1][5];
myTempArray[6]=myOrdersArray[j-1][6];
myTempArray[7]=myOrdersArray[j-1][7];
myTempArray[8]=myOrdersArray[j-1][8];
myTempArray[9]=myOrdersArray[j-1][9];
myTempArray[10]=myOrdersArray[j-1][10];
myTempArray[11]=myOrdersArray[j-1][11];
myOrdersArray[j-1][0]=myOrdersArray[j][0];
myOrdersArray[j-1][1]=myOrdersArray[j][1];
myOrdersArray[j-1][2]=myOrdersArray[j][2];
myOrdersArray[j-1][3]=myOrdersArray[j][3];
myOrdersArray[j-1][4]=myOrdersArray[j][4];
myOrdersArray[j-1][5]=myOrdersArray[j][5];
myOrdersArray[j-1][6]=myOrdersArray[j][6];
myOrdersArray[j-1][7]=myOrdersArray[j][7];
myOrdersArray[j-1][8]=myOrdersArray[j][8];
myOrdersArray[j-1][9]=myOrdersArray[j][9];
myOrdersArray[j-1][10]=myOrdersArray[j][10];
myOrdersArray[j-1][11]=myOrdersArray[j][11];
myOrdersArray[j][0]=myTempArray[0];
myOrdersArray[j][1]=myTempArray[1];
myOrdersArray[j][2]=myTempArray[2];
myOrdersArray[j][3]=myTempArray[3];
myOrdersArray[j][4]=myTempArray[4];
myOrdersArray[j][5]=myTempArray[5];
myOrdersArray[j][6]=myTempArray[6];
myOrdersArray[j][7]=myTempArray[7];
myOrdersArray[j][8]=myTempArray[8];
myOrdersArray[j][9]=myTempArray[9];
myOrdersArray[j][10]=myTempArray[10];
myOrdersArray[j][11]=myTempArray[11];
}
}
}
if (myOrderSort==1 && myMaxMin==1) //x,1,1
{
for (cnt=myArrayRange;cnt>=0;cnt--)
{
if (myOrdersArray[cnt][0]!=0 && myOrderType==NormalizeDouble(myOrdersArray[cnt][3],0) && myOrdersArray[cnt][2]>0)
{
myReturn=NormalizeDouble(myOrdersArray[cnt][0],0);
break;
}
}
}
if (myOrderSort==1 && myMaxMin==0) //x,1,0
{
for (cnt=0;cnt
{
if (myOrdersArray[cnt][0]!=0 && myOrderType==NormalizeDouble(myOrdersArray[cnt][3],0) && myOrdersArray[cnt][2]>0)
{
myReturn=NormalizeDouble(myOrdersArray[cnt][0],0);
break;
}
}
}
if (myOrderSort==2 && myMaxMin==0) //x,2,1
{
for (cnt=myArrayRange;cnt>=0;cnt--)
{
if (myOrdersArray[cnt][0]!=0 && myOrderType==NormalizeDouble(myOrdersArray[cnt][3],0) && myOrdersArray[cnt][2]<0)
{
myReturn=NormalizeDouble(myOrdersArray[cnt][0],0);
break;
}
}
}
if (myOrderSort==2 && myMaxMin==1) //x,2,0
{
for (cnt=0;cnt
{
if (myOrdersArray[cnt][0]!=0 && myOrderType==NormalizeDouble(myOrdersArray[cnt][3],0) && myOrdersArray[cnt][2]<0)
{
myReturn=NormalizeDouble(myOrdersArray[cnt][0],0);
break;
}
}
}
}
//---- 按開倉價降序排列數組,原始數組重新排序
if (myOrderSort==3)
{
for (i=0;i<=myArrayRange;i++)
{
for (j=myArrayRange;j>i;j--)
{
if (myOrdersArray[j][5]>myOrdersArray[j-1][5])
{
myTempArray[0]=myOrdersArray[j-1][0];
myTempArray[1]=myOrdersArray[j-1][1];
myTempArray[2]=myOrdersArray[j-1][2];
myTempArray[3]=myOrdersArray[j-1][3];
myTempArray[4]=myOrdersArray[j-1][4];
myTempArray[5]=myOrdersArray[j-1][5];
myTempArray[6]=myOrdersArray[j-1][6];
myTempArray[7]=myOrdersArray[j-1][7];
myTempArray[8]=myOrdersArray[j-1][8];
myTempArray[9]=myOrdersArray[j-1][9];
myTempArray[10]=myOrdersArray[j-1][10];
myTempArray[11]=myOrdersArray[j-1][11];
myOrdersArray[j-1][0]=myOrdersArray[j][0];
myOrdersArray[j-1][1]=myOrdersArray[j][1];
myOrdersArray[j-1][2]=myOrdersArray[j][2];
myOrdersArray[j-1][3]=myOrdersArray[j][3];
myOrdersArray[j-1][4]=myOrdersArray[j][4];
myOrdersArray[j-1][5]=myOrdersArray[j][5];
myOrdersArray[j-1][6]=myOrdersArray[j][6];
myOrdersArray[j-1][7]=myOrdersArray[j][7];
myOrdersArray[j-1][8]=myOrdersArray[j][8];
myOrdersArray[j-1][9]=myOrdersArray[j][9];
myOrdersArray[j-1][10]=myOrdersArray[j][10];
myOrdersArray[j-1][11]=myOrdersArray[j][11];
myOrdersArray[j][0]=myTempArray[0];
myOrdersArray[j][1]=myTempArray[1];
myOrdersArray[j][2]=myTempArray[2];
myOrdersArray[j][3]=myTempArray[3];
myOrdersArray[j][4]=myTempArray[4];
myOrdersArray[j][5]=myTempArray[5];
myOrdersArray[j][6]=myTempArray[6];
myOrdersArray[j][7]=myTempArray[7];
myOrdersArray[j][8]=myTempArray[8];
myOrdersArray[j][9]=myTempArray[9];
myOrdersArray[j][10]=myTempArray[10];
myOrdersArray[j][11]=myTempArray[11];
}
}
}
if (myMaxMin==1) //x,3,0
{
for (cnt=myArrayRange;cnt>=0;cnt--)
{
if (myOrdersArray[cnt][0]!=0 && myOrderType==NormalizeDouble(myOrdersArray[cnt][3],0) && myOrdersArray[cnt][5]>0)
{
myReturn=NormalizeDouble(myOrdersArray[cnt][0],0);
break;
}
}
}
if (myMaxMin==0) //x,3,1
{
for (cnt=0;cnt
{
if (myOrdersArray[cnt][0]!=0 && myOrderType==NormalizeDouble(myOrdersArray[cnt][3],0) && myOrdersArray[cnt][5]>0)
{
myReturn=NormalizeDouble(myOrdersArray[cnt][0],0);
break;
}
}
}
}
return(myReturn);
}
bool iValidTime(string myStartTime,string myEndTime,bool myServerTime)
{
bool myValue=false;
int myST,myET;
if (myServerTime==true)
{
myST=StrToTime(Year()+"."+Month()+"."+Day()+" "+myStartTime);
myET=StrToTime(Year()+"."+Month()+"."+Day()+" "+myEndTime);
}
if (myServerTime==false)
{
myST=StrToTime(myStartTime);
myET=StrToTime(myEndTime);
}
if (myST>myET) myET=myET+1440*60;
if (TimeCurrent()>myST && TimeCurrent()
{
myValue=true;
}
if (TimeLocal()>myST && TimeLocal()
{
myValue=true;
}
if (myST==myET) myValue=true;
return(myValue);
}
void iWait(int myDelayTime)
{
while (!IsTradeAllowed() || IsTradeContextBusy()) Sleep(myDelayTime);
RefreshRates();
return(0);
}
string iGetErrorInfo(int myErrorNum)
{
string myLastErrorStr;
if(myErrorNum>=0)
{
switch (myErrorNum)
{
case 0:myLastErrorStr="錯誤代碼:"+0+"-沒有錯誤返回";break;
case 1:myLastErrorStr="錯誤代碼:"+1+"-沒有錯誤返回但結果不明";break;
case 2:myLastErrorStr="錯誤代碼:"+2+"-一般錯誤";break;
case 3:myLastErrorStr="錯誤代碼:"+3+"-無效交易參量";break;
case 4:myLastErrorStr="錯誤代碼:"+4+"-交易服務器繁忙";break;
case 5:myLastErrorStr="錯誤代碼:"+5+"-客戶終端舊版本";break;
case 6:myLastErrorStr="錯誤代碼:"+6+"-沒有連接服務器";break;
case 7:myLastErrorStr="錯誤代碼:"+7+"-沒有權限";break;
case 8:myLastErrorStr="錯誤代碼:"+8+"-請求過於頻繁";break;
case 9:myLastErrorStr="錯誤代碼:"+9+"-交易運行故障";break;
case 64:myLastErrorStr="錯誤代碼:"+64+"-賬戶禁止";break;
case 65:myLastErrorStr="錯誤代碼:"+65+"-無效賬戶";break;
case 128:myLastErrorStr="錯誤代碼:"+128+"-交易超時";break;
case 129:myLastErrorStr="錯誤代碼:"+129+"-無效價格";break;
case 130:myLastErrorStr="錯誤代碼:"+130+"-無效停止";break;
case 131:myLastErrorStr="錯誤代碼:"+131+"-無效交易量";break;
case 132:myLastErrorStr="錯誤代碼:"+132+"-市場關閉";break;
case 133:myLastErrorStr="錯誤代碼:"+133+"-交易被禁止";break;
case 134:myLastErrorStr="錯誤代碼:"+134+"-資金不足";break;
case 135:myLastErrorStr="錯誤代碼:"+135+"-價格改變";break;
case 136:myLastErrorStr="錯誤代碼:"+136+"-開價";break;
case 137:myLastErrorStr="錯誤代碼:"+137+"-經紀繁忙";break;
case 138:myLastErrorStr="錯誤代碼:"+138+"-重新開價";break;
case 139:myLastErrorStr="錯誤代碼:"+139+"-定單被鎖定";break;
case 140:myLastErrorStr="錯誤代碼:"+140+"-只允許看漲倉位";break;
case 141:myLastErrorStr="錯誤代碼:"+141+"-過多請求";break;
case 145:myLastErrorStr="錯誤代碼:"+145+"-因為過於接近市場,修改無效";break;
case 146:myLastErrorStr="錯誤代碼:"+146+"-交易文本已滿";break;
case 147:myLastErrorStr="錯誤代碼:"+147+"-時間周期被經紀否定";break;
case 148:myLastErrorStr="錯誤代碼:"+148+"-開單和掛單總數已被經紀限定";break;
case 149:myLastErrorStr="錯誤代碼:"+149+"-當對沖被拒絕時,打開相對於現有的一個單量";break;
case 150:myLastErrorStr="錯誤代碼:"+150+"-把為反FIFO規定的單子平掉";break;
case 4000:myLastErrorStr="錯誤代碼:"+4000+"-沒有錯誤";break;
case 4001:myLastErrorStr="錯誤代碼:"+4001+"-錯誤函數指示";break;
case 4002:myLastErrorStr="錯誤代碼:"+4002+"-數組索引超出范圍";break;
case 4003:myLastErrorStr="錯誤代碼:"+4003+"-對於調用堆棧儲存器函數沒有足夠內存";break;
case 4004:myLastErrorStr="錯誤代碼:"+4004+"-循環堆棧儲存器溢出";break;
case 4005:myLastErrorStr="錯誤代碼:"+4005+"-對於堆棧儲存器參量沒有內存";break;
case 4006:myLastErrorStr="錯誤代碼:"+4006+"-對於字行參量沒有足夠內存";break;
case 4007:myLastErrorStr="錯誤代碼:"+4007+"-對於字行沒有足夠內存";break;
case 4008:myLastErrorStr="錯誤代碼:"+4008+"-沒有初始字行";break;
case 4009:myLastErrorStr="錯誤代碼:"+4009+"-在數組中沒有初始字串符";break;
case 4010:myLastErrorStr="錯誤代碼:"+4010+"-對於數組沒有內存";break;
case 4011:myLastErrorStr="錯誤代碼:"+4011+"-字行過長";break;
case 4012:myLastErrorStr="錯誤代碼:"+4012+"-余數劃分為零";break;
case 4013:myLastErrorStr="錯誤代碼:"+4013+"-零劃分";break;
case 4014:myLastErrorStr="錯誤代碼:"+4014+"-不明命令";break;
case 4015:myLastErrorStr="錯誤代碼:"+4015+"-錯誤轉換(沒有常規錯誤)";break;
case 4016:myLastErrorStr="錯誤代碼:"+4016+"-沒有初始數組";break;
case 4017:myLastErrorStr="錯誤代碼:"+4017+"-禁止調用DLL ";break;
case 4018:myLastErrorStr="錯誤代碼:"+4018+"-數據庫不能下載";break;
case 4019:myLastErrorStr="錯誤代碼:"+4019+"-不能調用函數";break;
case 4020:myLastErrorStr="錯誤代碼:"+4020+"-禁止調用智能交易函數";break;
case 4021:myLastErrorStr="錯誤代碼:"+4021+"-對於來自函數的字行沒有足夠內存";break;
case 4022:myLastErrorStr="錯誤代碼:"+4022+"-系統繁忙 (沒有常規錯誤)";break;
case 4050:myLastErrorStr="錯誤代碼:"+4050+"-無效計數參量函數";break;
case 4051:myLastErrorStr="錯誤代碼:"+4051+"-無效開倉量";break;
case 4052:myLastErrorStr="錯誤代碼:"+4052+"-字行函數內部錯誤";break;
case 4053:myLastErrorStr="錯誤代碼:"+4053+"-一些數組錯誤";break;
case 4054:myLastErrorStr="錯誤代碼:"+4054+"-應用不正確數組";break;
case 4055:myLastErrorStr="錯誤代碼:"+4055+"-自定義指標錯誤";break;
case 4056:myLastErrorStr="錯誤代碼:"+4056+"-不協調數組";break;
case 4057:myLastErrorStr="錯誤代碼:"+4057+"-整體變量過程錯誤";break;
case 4058:myLastErrorStr="錯誤代碼:"+4058+"-整體變量未找到";break;
case 4059:myLastErrorStr="錯誤代碼:"+4059+"-測試模式函數禁止";break;
case 4060:myLastErrorStr="錯誤代碼:"+4060+"-沒有確認函數";break;
case 4061:myLastErrorStr="錯誤代碼:"+4061+"-發送郵件錯誤";break;
case 4062:myLastErrorStr="錯誤代碼:"+4062+"-字行預計參量";break;
case 4063:myLastErrorStr="錯誤代碼:"+4063+"-整數預計參量";break;
case 4064:myLastErrorStr="錯誤代碼:"+4064+"-雙預計參量";break;
case 4065:myLastErrorStr="錯誤代碼:"+4065+"-數組作為預計參量";break;
case 4066:myLastErrorStr="錯誤代碼:"+4066+"-刷新狀態請求歷史數據";break;
case 4067:myLastErrorStr="錯誤代碼:"+4067+"-交易函數錯誤";break;
case 4099:myLastErrorStr="錯誤代碼:"+4099+"-文件結束";break;
case 4100:myLastErrorStr="錯誤代碼:"+4100+"-一些文件錯誤";break;
case 4101:myLastErrorStr="錯誤代碼:"+4101+"-錯誤文件名稱";break;
case 4102:myLastErrorStr="錯誤代碼:"+4102+"-打開文件過多";break;
case 4103:myLastErrorStr="錯誤代碼:"+4103+"-不能打開文件";break;
case 4104:myLastErrorStr="錯誤代碼:"+4104+"-不協調文件";break;
case 4105:myLastErrorStr="錯誤代碼:"+4105+"-沒有選擇定單";break;
case 4106:myLastErrorStr="錯誤代碼:"+4106+"-不明貨幣對";break;
case 4107:myLastErrorStr="錯誤代碼:"+4107+"-無效價格";break;
case 4108:myLastErrorStr="錯誤代碼:"+4108+"-無效定單編碼";break;
case 4109:myLastErrorStr="錯誤代碼:"+4109+"-不允許交易";break;
case 4110:myLastErrorStr="錯誤代碼:"+4110+"-不允許長期";break;
case 4111:myLastErrorStr="錯誤代碼:"+4111+"-不允許短期";break;
case 4200:myLastErrorStr="錯誤代碼:"+4200+"-定單已經存在";break;
case 4201:myLastErrorStr="錯誤代碼:"+4201+"-不明定單屬性";break;
case 4202:myLastErrorStr="錯誤代碼:"+4202+"-定單不存在";break;
case 4203:myLastErrorStr="錯誤代碼:"+4203+"-不明定單類型";break;
case 4204:myLastErrorStr="錯誤代碼:"+4204+"-沒有定單名稱";break;
case 4205:myLastErrorStr="錯誤代碼:"+4205+"-定單坐標錯誤";break;
case 4206:myLastErrorStr="錯誤代碼:"+4206+"-沒有指定子窗口";break;
case 4207:myLastErrorStr="錯誤代碼:"+4207+"-定單一些函數錯誤";break;
case 4250:myLastErrorStr="錯誤代碼:"+4250+"-錯誤設定發送通知到隊列中";break;
case 4251:myLastErrorStr="錯誤代碼:"+4251+"-無效參量- 空字符串傳遞到SendNotification()函數";break;
case 4252:myLastErrorStr="錯誤代碼:"+4252+"-無效設置發送通知(未指定ID或未啟用通知)";break;
case 4253:myLastErrorStr="錯誤代碼:"+4253+"-通知發送過於頻繁";break;
}
}
return(myLastErrorStr);
}
int iOrderEquitToPoint(int myTicket)
{
int myPoint=0;
if (OrderSelect(myTicket,SELECT_BY_TICKET,MODE_TRADES))
{
if (OrderType()==OP_BUY)
{
myPoint=(Bid-OrderOpenPrice())/Point;
}
if (OrderType()==OP_SELL)
{
myPoint=(OrderOpenPrice()-Ask)/Point;
}
}
return(myPoint);
}
double iFundsToHands(string mySymbol,double myFunds)
{
double myLots=myFunds/MarketInfo(mySymbol, MODE_MARGINREQUIRED);//換算可開倉手數
myLots=MathRound(myLots/MarketInfo(mySymbol, MODE_MINLOT))*MarketInfo(Symbol(), MODE_MINLOT);//手數整形
return(myLots);
}
void iDisplayInfo(string LableName,string LableDoc,int Corner,int LableX,int LableY,int DocSize,string DocStyle,color DocColor)
{
if (Corner == -1) return(0);
ObjectCreate(LableName, OBJ_LABEL, 0, 0, 0);
ObjectSetText(LableName, LableDoc, DocSize, DocStyle,DocColor);
ObjectSet(LableName, OBJPROP_CORNER, Corner);
ObjectSet(LableName, OBJPROP_XDISTANCE, LableX);
ObjectSet(LableName, OBJPROP_YDISTANCE, LableY);
}
近日,京東發布《京東區塊鏈技術實踐白皮書(2019)》,再度將京東在區塊鏈領域的戰略布局集中展現在公眾視野。通過這份白皮書,以及相關新聞資
比特幣在跌破6000大關後又反彈至近11000美元左右,這樣的行情著實可以用“過山車”來形容,但事實上這樣的暴漲暴跌對於比特幣來說並非新鮮
區塊鏈有什麼優點?1、安全性極大提高因為沒有中心大賬本,而是每個人手中都有一個同樣的賬本,摧毀單個人手中的賬本不會對系統造成任何影響,賬本
GPU挖掘硬件算法是內存難解的,為了使DAG適合內存,每個GPU需要1-2GB內存,如果你得到錯誤提示:Error GPU mining.
目前,區塊鏈技術已開始在實體經濟的很多領域實現落地應用。區塊鏈具有分布式、不可篡改、可追溯等特性,在實體經濟的改造中已經開始了廣泛的探索並
排放指標期貨是什麼 排放指標期貨是指該商品由交易所統一制定、實行集中
外_匯_邦 WaiHuiBang.com 1、理解系統的真相 交易是一個概率的游戲。想像我們正
股票市場交易中很多投資者都向往股票價格買到最低點、賣到最高點。但是很多投資為了追求這一點,本來賺錢的股票卻因為股票價格回調,導致股
惠衢保在杭州看病是否可以報銷需要看具體情況,惠衢保可保障自付醫療費用,自費醫療費用和特殊藥品費用。其中,
最佳答案: 2019年4月1日~2019年4月4日期間,可參加支付寶還款有禮的活動,可以獲得免費還款