  
等级: 版主
- 注册:
- 2021-5-25
- 曾用名:
|
//去掉了全局变量设置。
//去掉了加仓方案设置,加仓方案按照数组里面设置。
//增加了停止开新仓的设置,意思是当前一波结束了不再下单。
//ea运行途中可随时设置参数,不会影响运行效果。
#property version "1.00"
#property description "间隔:0, 20,20,15,15,20,20,30。"
#property description "倍率:1, 2, 1, 2, 1, 3, 2, 4。"
#property description "最大交易量5手,大于5手不开仓。"
#property strict
//-------------------------------------------------------------------
input int Magic=1800; //魔术码
input bool IsStop=false; //当前一波结束是否停止
input double lots=0.01; //初始手数
//-加仓时的间隔点数,数组从0开始
int Interval_Pips[20]= {0, 20,20,15,15,20,20,30};
//-加仓时的交易量倍数
int Interval_Lots[20]= {1, 2, 1, 2, 1, 3, 2, 4};
int slippage=3;
input int TP=300; //止盈点数
input int SL=2000;//止损点数
//止损点数为第一单的止损点数计算出来的价格作为每一单的止损价。加仓的时候会考虑下单价格距离止损价太近就不加仓。
string comt="WinKey->";
int i,db=1;
int Digitslots;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//----
double minlot=MarketInfo(Symbol(),MODE_MINLOT);
if(minlot==0.001) Digitslots=3;
if(minlot==0.01) Digitslots=2;
if(minlot==0.1) Digitslots=1;
if(MarketInfo(Symbol(),MODE_DIGITS)==5 || MarketInfo(Symbol(),MODE_DIGITS)==3)
{
Print("五位小数平台.");
db=10;
}
else Print("四位小数平台.");
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//----
Comment("");
//----
return;
}
//+------------------------------------------------------------------+
//| expert start function |
//+-------------------------------------------
|
|