设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一段代码设置一[codebuy=1]
- int ContinueTPNum(int MagicX)
- {
- int Num=0;
- for(int i=OrdersHistoryTotal()-1; i>=0; i--)
- if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
- if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicX)
- {
- if(OrderProfit()+OrderSwap()+OrderCommission()>0)
- Num++;
- else
- break;
- }
- return(Num);
-
- }
复制代码
[/codebuy][codebuy=2]- int ContinueTPNum(int MagicX)
- {
- int Num=0;
- for(int i=OrdersHistoryTotal()-1; i>=0; i--)
- if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
- if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicX)
- {
- if(OrderProfit()+OrderSwap()+OrderCommission()>0)
- Num++;
- else
- break;
- }
- return(Num);
-
- }
复制代码
[/codebuy][codebuy=2]- int ContinueProfitTimes(string SymbolX,int OrderTypeX,int MagicX,string ModeX,double ProfitX)
- {
- int ProfitTimes=0;
- for(int i=OrdersHistoryTotal()-1; i>=0; i--)
- if(OrderSelect(i, SELECT_BY_POS,MODE_HISTORY))
- if((OrderSymbol()==SymbolX ||SymbolX=="-1")&& (OrderMagicNumber()==MagicX || MagicX==-1)&&(OrderType()==OrderTypeX || OrderTypeX==-1))
- {
- if((ModeX==">" && OrderProfit()+OrderSwap()+OrderCommission()>ProfitX)||(ModeX=="<" && OrderProfit()+OrderSwap()+OrderCommission()<ProfitX))
- ProfitTimes++;
- else
- break;
- }
- return ProfitTimes;
- }
复制代码
[/codebuy][codebuy=5]- int ContinueProfitTimes(string SymbolX,int OrderTypeX,int MagicX,string ModeX,double ProfitX)
- {
- int ProfitTimes=0;
- for(int i=OrdersHistoryTotal()-1; i>=0; i--)
- if(OrderSelect(i, SELECT_BY_POS,MODE_HISTORY))
- if((OrderSymbol()==SymbolX ||SymbolX=="-1")&& (OrderMagicNumber()==MagicX || MagicX==-1)&&(OrderType()==OrderTypeX || OrderTypeX==-1))
- {
- if((ModeX==">" && OrderProfit()+OrderSwap()+OrderCommission()>ProfitX)||(ModeX=="<" && OrderProfit()+OrderSwap()+OrderCommission()<ProfitX))
- ProfitTimes++;
- else
- break;
- }
- return ProfitTimes;
- }
复制代码
[/codebuy] |