FM-RB

FM-RB

官方版 无广告 54

更新日期:2022-11-08 分类标签: 语言:中文 平台:没限制

15 人已下载 手机查看

FM-RB

//+------------------------------------------------------------------+
//| FM-RedBox NEW.mq4 |
//| |
//| |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
//-----------------------相疣戾蝠?-----------------------------------+
extern string c0="------------------------";
extern double Risk =5; //需耜 ?镳铞屙蜞?铗 徉豚眈?
extern double StopProcent =0; //俞铌 ?镳铞屙蜞?
extern string c1="------------------------";
extern string SYMBOL_1 ="EURUSD"; //翌疸钼? 镟疣
extern string SYMBOL_2 ="GBPUSD"; //翌疸钼? 镟疣
extern string SYMBOL_3 ="USDJPY"; //翌疸钼? 镟疣
extern string SYMBOL_4 ="EURJPY"; //翌疸钼? 镟疣
extern string SYMBOL_5 ="USDCAD"; //翌疸钼? 镟疣
extern string SYMBOL_6 ="USDCHF"; //翌疸钼? 镟疣
extern string SYMBOL_7 ="AUDUSD"; //翌疸钼? 镟疣
extern string SYMBOL_8 ="NZDUSD"; //翌疸钼? 镟疣
extern string SYMBOL_9 ="EURUSD"; //翌疸钼? 镟疣
extern string SYMBOL_10 ="EURGBP"; //翌疸钼? 镟疣
extern string SYMBOL_11 ="EURAUD"; //翌疸钼? 镟疣
extern string SYMBOL_12 ="EURCHF"; //翌疸钼? 镟疣
extern string SYMBOL_13 ="GBPJPY"; //翌疸钼? 镟疣
extern string SYMBOL_14 ="GBPCAD"; //翌疸钼? 镟疣
extern string SYMBOL_15 ="GBPAUD"; //翌疸钼? 镟疣
extern string SYMBOL_16 ="GBPCHF"; //翌疸钼? 镟疣
extern string SYMBOL_17 ="CADJPY"; //翌疸钼? 镟疣
extern string SYMBOL_18 ="AUDCHF"; //翌疸钼? 镟疣
extern string SYMBOL_19 ="AUDJPY"; //翌疸钼? 镟疣
extern string SYMBOL_20 ="CHFJPY"; //翌疸钼? 镟疣
extern string c2="------------------------";
extern int Kper =14; //襄痂钿 枢磬朦眍泐 桧滂赅蝾疣
extern int Maper =40; //襄痂钿 耩邃礤?赅磬朦眍泐 桧滂赅蝾疣
extern int OverBou =90; //绣泱腓痤怅?痂睇 赅磬豚
extern int OverSold =10; //绣泱腓痤怅?痂睇 赅磬豚
extern int Sper =2; //襄痂钿 腓礤轫钽?桧滂赅蝾疣
extern string c3="------------------------";
extern int Tral =30; //茵嚯 ?矬黻蜞?
extern int TF =30; //亦殪 麴彘??扈眢蜞? 锐镱朦珞? 珥圜屙? 1,5,15,30,60,240,1440
extern int Magic =7777; //锑痍屦 铕溴痤?耦忮蝽桕?
//--------------------------------------------------------------------+
int Otstup =5; //悟耱箫 耔沩嚯?铗 忮瘌桧?徉疣
int CountBars =100; //阻耠?徉痤?磬 觐蝾瘥?狍溴?铗钺疣驽?耔沩嚯
//+------------------------------+
int Slow =3;
int Dper =3;
int Mametod =1;
int Mapric =0;
int Stimewind =34;
int Sensetiv =8;

double UpLot =1; //羊屣屙?筲咫梓屙? 腩蜞
int Step =5000; //剜?皴蜿?
string CommentEA ="FM-RedBox";
int TralStep =0;
datetime NewBar =0;
int D;
bool Buy1,Sell1,Buy2,Sell2,Buy3,Sell3,Buy4,Sell4,Buy5,Sell5,Buy6,Sell6,Buy7,Sell7,Buy8,Sell8,Buy9,Sell9,Buy10,Sell10,Buy11,Sell11,Buy12,Sell12,Buy13,Sell13,Buy14,Sell14,Buy15,Sell15,Buy16,Sell16,Buy17,Sell17,Buy18,Sell18,Buy19,Sell19,Buy20,Sell20,mod;
int init()
{D=1;
if (Digits==5 || Digits==3)D=10;
return(0);}
//--------------------------------------------------------------------+
int start(){
//--------------------------------------------------------------------+
double Lot=0;
Lot=NormalizeDouble(AccountBalance()/100*Risk/(MarketInfo(Symbol(),MODE_TICKVALUE)*100*D),2);
if (Lot<MarketInfo(Symbol(),MODE_MINLOT))Lot=MarketInfo(Symbol(),MODE_MINLOT);

if(MarketInfo(Symbol(),MODE_LOTSTEP)==0.01) int dig =2;
if(MarketInfo(Symbol(),MODE_LOTSTEP)==0.10) dig =1;
if(MarketInfo(Symbol(),MODE_LOTSTEP)==1.00) dig =0;
//--------------------------------------------------------------------+
double NewLot1=Lot*(MathPow(UpLot,Count(-1,SYMBOL_1)));
double NewLot2=Lot*(MathPow(UpLot,Count(-1,SYMBOL_2)));
double NewLot3=Lot*(MathPow(UpLot,Count(-1,SYMBOL_3)));
double NewLot4=Lot*(MathPow(UpLot,Count(-1,SYMBOL_4)));
double NewLot5=Lot*(MathPow(UpLot,Count(-1,SYMBOL_5)));
double NewLot6=Lot*(MathPow(UpLot,Count(-1,SYMBOL_6)));
double NewLot7=Lot*(MathPow(UpLot,Count(-1,SYMBOL_7)));
double NewLot8=Lot*(MathPow(UpLot,Count(-1,SYMBOL_8)));
double NewLot9=Lot*(MathPow(UpLot,Count(-1,SYMBOL_9)));
double NewLot10=Lot*(MathPow(UpLot,Count(-1,SYMBOL_10)));
double NewLot11=Lot*(MathPow(UpLot,Count(-1,SYMBOL_11)));
double NewLot12=Lot*(MathPow(UpLot,Count(-1,SYMBOL_12)));
double NewLot13=Lot*(MathPow(UpLot,Count(-1,SYMBOL_13)));
double NewLot14=Lot*(MathPow(UpLot,Count(-1,SYMBOL_14)));
double NewLot15=Lot*(MathPow(UpLot,Count(-1,SYMBOL_15)));
double NewLot16=Lot*(MathPow(UpLot,Count(-1,SYMBOL_16)));
double NewLot17=Lot*(MathPow(UpLot,Count(-1,SYMBOL_17)));
double NewLot18=Lot*(MathPow(UpLot,Count(-1,SYMBOL_18)));
double NewLot19=Lot*(MathPow(UpLot,Count(-1,SYMBOL_19)));
double NewLot20=Lot*(MathPow(UpLot,Count(-1,SYMBOL_20)));
//--------------------------茵彘腓磴 耱铒------------------------------+
if(Count(-1,SYMBOL_1)==1)
{Trail(Magic,SYMBOL_1); }
if(Count(-1,SYMBOL_2)==1)
{Trail(Magic,SYMBOL_2); }
if(Count(-1,SYMBOL_3)==1)
{Trail(Magic,SYMBOL_3); }
if(Count(-1,SYMBOL_4)==1)
{Trail(Magic,SYMBOL_4); }
if(Count(-1,SYMBOL_5)==1)
{Trail(Magic,SYMBOL_5); }

if(Count(-1,SYMBOL_6)==1)
{Trail(Magic,SYMBOL_6); }
if(Count(-1,SYMBOL_7)==1)
{Trail(Magic,SYMBOL_7); }
if(Count(-1,SYMBOL_8)==1)
{Trail(Magic,SYMBOL_8); }
if(Count(-1,SYMBOL_9)==1)
{Trail(Magic,SYMBOL_9); }
if(Count(-1,SYMBOL_10)==1)
{Trail(Magic,SYMBOL_10); }

if(Count(-1,SYMBOL_11)==1)
{Trail(Magic,SYMBOL_11); }
if(Count(-1,SYMBOL_12)==1)
{Trail(Magic,SYMBOL_12); }
if(Count(-1,SYMBOL_13)==1)
{Trail(Magic,SYMBOL_13); }
if(Count(-1,SYMBOL_14)==1)
{Trail(Magic,SYMBOL_14); }
if(Count(-1,SYMBOL_15)==1)
{Trail(Magic,SYMBOL_15); }

if(Count(-1,SYMBOL_16)==1)
{Trail(Magic,SYMBOL_16); }
if(Count(-1,SYMBOL_17)==1)
{Trail(Magic,SYMBOL_17); }
if(Count(-1,SYMBOL_18)==1)
{Trail(Magic,SYMBOL_18); }
if(Count(-1,SYMBOL_19)==1)
{Trail(Magic,SYMBOL_19); }
if(Count(-1,SYMBOL_20)==1)
{Trail(Magic,SYMBOL_20); }
//--------------------------------------------------------------------+
if(NewBar!= Time[0])
{NewBar = Time[0];

Buy1=false;Sell1=false;
if (iCustom(SYMBOL_1,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell1=true;
if (iCustom(SYMBOL_1,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy1=true;

Buy2=false;Sell2=false;
if (iCustom(SYMBOL_2,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell2=true;
if (iCustom(SYMBOL_2,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy2=true;

Buy3=false;Sell3=false;
if (iCustom(SYMBOL_3,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell3=true;
if (iCustom(SYMBOL_3,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy3=true;

Buy4=false;Sell4=false;
if (iCustom(SYMBOL_4,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell4=true;
if (iCustom(SYMBOL_4,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy4=true;

Buy5=false;Sell5=false;
if (iCustom(SYMBOL_5,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell5=true;
if (iCustom(SYMBOL_5,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy5=true;

Buy6=false;Sell6=false;
if (iCustom(SYMBOL_6,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell6=true;
if (iCustom(SYMBOL_6,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy6=true;

Buy7=false;Sell7=false;
if (iCustom(SYMBOL_7,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell7=true;
if (iCustom(SYMBOL_7,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy7=true;

Buy8=false;Sell8=false;
if (iCustom(SYMBOL_8,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell8=true;
if (iCustom(SYMBOL_8,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy8=true;

Buy9=false;Sell9=false;
if (iCustom(SYMBOL_9,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell9=true;
if (iCustom(SYMBOL_9,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy9=true;

Buy10=false;Sell10=false;
if (iCustom(SYMBOL_10,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell10=true;
if (iCustom(SYMBOL_10,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy10=true;

Buy11=false;Sell11=false;
if (iCustom(SYMBOL_11,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell11=true;
if (iCustom(SYMBOL_11,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy11=true;

Buy12=false;Sell12=false;
if (iCustom(SYMBOL_12,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell12=true;
if (iCustom(SYMBOL_12,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy12=true;

Buy13=false;Sell13=false;
if (iCustom(SYMBOL_13,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell13=true;
if (iCustom(SYMBOL_13,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy13=true;

Buy14=false;Sell14=false;
if (iCustom(SYMBOL_14,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell14=true;
if (iCustom(SYMBOL_14,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy14=true;

Buy15=false;Sell15=false;
if (iCustom(SYMBOL_15,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell15=true;
if (iCustom(SYMBOL_15,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy15=true;

Buy16=false;Sell16=false;
if (iCustom(SYMBOL_16,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell16=true;
if (iCustom(SYMBOL_16,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy16=true;

Buy17=false;Sell17=false;
if (iCustom(SYMBOL_17,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell17=true;
if (iCustom(SYMBOL_17,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy17=true;

Buy18=false;Sell18=false;
if (iCustom(SYMBOL_18,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell18=true;
if (iCustom(SYMBOL_18,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy18=true;

Buy19=false;Sell19=false;
if (iCustom(SYMBOL_19,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell19=true;
if (iCustom(SYMBOL_19,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy19=true;

Buy20=false;Sell20=false;
if (iCustom(SYMBOL_20,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,0,1)!=0)Sell20=true;
if (iCustom(SYMBOL_20,TF,"fzsignal",Otstup,CountBars,Kper,Slow,Dper,Maper,Mametod,Mapric,OverBou,OverSold,Sper,Stimewind,Sensetiv,1,1)!=0)Buy20=true;

//--------------------------------------------------------------------+
if (Count(-1,SYMBOL_1)==0 && Buy1)
{int op1=OrderSend(SYMBOL_1,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_1,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_1)==0 && Sell1)
{int op2=OrderSend(SYMBOL_1,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_1,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_2)==0 && Buy2)
{int op3=OrderSend(SYMBOL_2,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_2,MODE_ASK), Digits),200,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_2)==0 && Sell2)
{int op4=OrderSend(SYMBOL_2,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_2,MODE_BID), Digits),200,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_3)==0 && Buy3)
{int op5=OrderSend(SYMBOL_3,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_3,MODE_ASK), Digits),300,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_3)==0 && Sell3)
{int op6=OrderSend(SYMBOL_3,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_3,MODE_BID), Digits),300,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_4)==0 && Buy4)
{int op7=OrderSend(SYMBOL_4,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_4,MODE_ASK), Digits),400,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_4)==0 && Sell4)
{int op8=OrderSend(SYMBOL_4,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_4,MODE_BID), Digits),400,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_5)==0 && Buy5)
{int op9=OrderSend(SYMBOL_5,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_5,MODE_ASK), Digits),500,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_5)==0 && Sell5)
{int op10=OrderSend(SYMBOL_5,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_5,MODE_BID), Digits),500,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_6)==0 && Buy6)
{int op11=OrderSend(SYMBOL_6,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_6,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_6)==0 && Sell6)
{int op12=OrderSend(SYMBOL_6,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_6,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_7)==0 && Buy7)
{int op13=OrderSend(SYMBOL_7,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_7,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_7)==0 && Sell7)
{int op14=OrderSend(SYMBOL_7,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_7,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_8)==0 && Buy8)
{int op15=OrderSend(SYMBOL_8,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_8,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_8)==0 && Sell8)
{int op16=OrderSend(SYMBOL_8,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_8,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_9)==0 && Buy9)
{int op17=OrderSend(SYMBOL_9,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_9,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_9)==0 && Sell9)
{int op18=OrderSend(SYMBOL_9,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_9,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_10)==0 && Buy10)
{int op19=OrderSend(SYMBOL_10,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_10,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_10)==0 && Sell10)
{int op20=OrderSend(SYMBOL_10,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_10,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_11)==0 && Buy11)
{int op21=OrderSend(SYMBOL_11,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_11,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_11)==0 && Sell11)
{int op22=OrderSend(SYMBOL_11,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_11,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_12)==0 && Buy12)
{int op23=OrderSend(SYMBOL_12,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_12,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_12)==0 && Sell12)
{int op24=OrderSend(SYMBOL_12,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_12,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_13)==0 && Buy13)
{int op25=OrderSend(SYMBOL_13,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_13,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_13)==0 && Sell13)
{int op26=OrderSend(SYMBOL_13,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_13,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_14)==0 && Buy14)
{int op27=OrderSend(SYMBOL_14,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_14,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_14)==0 && Sell14)
{int op28=OrderSend(SYMBOL_14,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_14,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_15)==0 && Buy15)
{int op29=OrderSend(SYMBOL_15,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_15,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_15)==0 && Sell15)
{int op30=OrderSend(SYMBOL_15,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_15,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_16)==0 && Buy16)
{int op31=OrderSend(SYMBOL_16,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_16,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_16)==0 && Sell16)
{int op32=OrderSend(SYMBOL_16,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_16,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_17)==0 && Buy17)
{int op33=OrderSend(SYMBOL_17,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_17,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_17)==0 && Sell17)
{int op34=OrderSend(SYMBOL_17,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_17,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_18)==0 && Buy18)
{int op35=OrderSend(SYMBOL_18,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_18,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_18)==0 && Sell18)
{int op36=OrderSend(SYMBOL_18,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_18,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_19)==0 && Buy19)
{int op37=OrderSend(SYMBOL_19,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_19,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_19)==0 && Sell19)
{int op38=OrderSend(SYMBOL_19,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_19,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if (Count(-1,SYMBOL_20)==0 && Buy20)
{int op39=OrderSend(SYMBOL_20,OP_BUY,Lot,NormalizeDouble(MarketInfo(SYMBOL_20,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if (Count(-1,SYMBOL_20)==0 && Sell20)
{int op40=OrderSend(SYMBOL_20,OP_SELL,Lot,NormalizeDouble(MarketInfo(SYMBOL_20,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

//--------------------------------------------------------------------+
if(Count(OP_BUY,SYMBOL_1)>0 && NormalizeDouble((MarketInfo(SYMBOL_1,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_1,MODE_POINT))), Digits)<=OldPricB(SYMBOL_1) && Buy1)
{int send1=OrderSend(SYMBOL_1,OP_BUY,NewLot1,NormalizeDouble(MarketInfo(SYMBOL_1,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_1)>0 && NormalizeDouble((MarketInfo(SYMBOL_1,MODE_BID)-Step*D*(MarketInfo(SYMBOL_1,MODE_POINT))), Digits)>=OldPricS(SYMBOL_1) && Sell1)
{int send2=OrderSend(SYMBOL_1,OP_SELL,NewLot1,NormalizeDouble(MarketInfo(SYMBOL_1,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_2)>0 && NormalizeDouble((MarketInfo(SYMBOL_2,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_2,MODE_POINT))), Digits)<=OldPricB(SYMBOL_2) && Buy2)
{int send3=OrderSend(SYMBOL_2,OP_BUY,NewLot2,NormalizeDouble(MarketInfo(SYMBOL_2,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_2)>0 && NormalizeDouble((MarketInfo(SYMBOL_2,MODE_BID)-Step*D*(MarketInfo(SYMBOL_2,MODE_POINT))), Digits)>=OldPricS(SYMBOL_2) && Sell2)
{int send4=OrderSend(SYMBOL_2,OP_SELL,NewLot2,NormalizeDouble(MarketInfo(SYMBOL_2,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_3)>0 && NormalizeDouble((MarketInfo(SYMBOL_3,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_3,MODE_POINT))), Digits)<=OldPricB(SYMBOL_3) && Buy3)
{int send5=OrderSend(SYMBOL_3,OP_BUY,NewLot3,NormalizeDouble(MarketInfo(SYMBOL_3,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_3)>0 && NormalizeDouble((MarketInfo(SYMBOL_3,MODE_BID)-Step*D*(MarketInfo(SYMBOL_3,MODE_POINT))), Digits)>=OldPricS(SYMBOL_3) && Sell3)
{int send6=OrderSend(SYMBOL_3,OP_SELL,NewLot3,NormalizeDouble(MarketInfo(SYMBOL_3,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_4)>0 && NormalizeDouble((MarketInfo(SYMBOL_4,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_4,MODE_POINT))), Digits)<=OldPricB(SYMBOL_4) && Buy4)
{int send7=OrderSend(SYMBOL_4,OP_BUY,NewLot4,NormalizeDouble(MarketInfo(SYMBOL_4,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_4)>0 && NormalizeDouble((MarketInfo(SYMBOL_4,MODE_BID)-Step*D*(MarketInfo(SYMBOL_4,MODE_POINT))), Digits)>=OldPricS(SYMBOL_4) && Sell4)
{int send8=OrderSend(SYMBOL_4,OP_SELL,NewLot4,NormalizeDouble(MarketInfo(SYMBOL_4,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_5)>0 && NormalizeDouble((MarketInfo(SYMBOL_5,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_5,MODE_POINT))), Digits)<=OldPricB(SYMBOL_5) && Buy5)
{int send9=OrderSend(SYMBOL_5,OP_BUY,NewLot5,NormalizeDouble(MarketInfo(SYMBOL_5,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_5)>0 && NormalizeDouble((MarketInfo(SYMBOL_5,MODE_BID)-Step*D*(MarketInfo(SYMBOL_5,MODE_POINT))), Digits)>=OldPricS(SYMBOL_5) && Sell5)
{int send10=OrderSend(SYMBOL_5,OP_SELL,NewLot5,NormalizeDouble(MarketInfo(SYMBOL_5,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_6)>0 && NormalizeDouble((MarketInfo(SYMBOL_6,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_6,MODE_POINT))), Digits)<=OldPricB(SYMBOL_6) && Buy6)
{int send11=OrderSend(SYMBOL_6,OP_BUY,NewLot6,NormalizeDouble(MarketInfo(SYMBOL_6,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_6)>0 && NormalizeDouble((MarketInfo(SYMBOL_6,MODE_BID)-Step*D*(MarketInfo(SYMBOL_6,MODE_POINT))), Digits)>=OldPricS(SYMBOL_6) && Sell6)
{int send12=OrderSend(SYMBOL_6,OP_SELL,NewLot6,NormalizeDouble(MarketInfo(SYMBOL_6,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_7)>0 && NormalizeDouble((MarketInfo(SYMBOL_7,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_7,MODE_POINT))), Digits)<=OldPricB(SYMBOL_7) && Buy7)
{int send13=OrderSend(SYMBOL_7,OP_BUY,NewLot7,NormalizeDouble(MarketInfo(SYMBOL_7,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_7)>0 && NormalizeDouble((MarketInfo(SYMBOL_7,MODE_BID)-Step*D*(MarketInfo(SYMBOL_7,MODE_POINT))), Digits)>=OldPricS(SYMBOL_7) && Sell7)
{int send14=OrderSend(SYMBOL_7,OP_SELL,NewLot7,NormalizeDouble(MarketInfo(SYMBOL_7,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_8)>0 && NormalizeDouble((MarketInfo(SYMBOL_8,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_8,MODE_POINT))), Digits)<=OldPricB(SYMBOL_8) && Buy8)
{int send15=OrderSend(SYMBOL_8,OP_BUY,NewLot8,NormalizeDouble(MarketInfo(SYMBOL_8,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_8)>0 && NormalizeDouble((MarketInfo(SYMBOL_8,MODE_BID)-Step*D*(MarketInfo(SYMBOL_8,MODE_POINT))), Digits)>=OldPricS(SYMBOL_8) && Sell8)
{int send16=OrderSend(SYMBOL_8,OP_SELL,NewLot8,NormalizeDouble(MarketInfo(SYMBOL_8,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_9)>0 && NormalizeDouble((MarketInfo(SYMBOL_9,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_9,MODE_POINT))), Digits)<=OldPricB(SYMBOL_9) && Buy9)
{int send17=OrderSend(SYMBOL_9,OP_BUY,NewLot9,NormalizeDouble(MarketInfo(SYMBOL_9,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_9)>0 && NormalizeDouble((MarketInfo(SYMBOL_9,MODE_BID)-Step*D*(MarketInfo(SYMBOL_9,MODE_POINT))), Digits)>=OldPricS(SYMBOL_9) && Sell9)
{int send18=OrderSend(SYMBOL_9,OP_SELL,NewLot9,NormalizeDouble(MarketInfo(SYMBOL_9,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_10)>0 && NormalizeDouble((MarketInfo(SYMBOL_10,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_10,MODE_POINT))), Digits)<=OldPricB(SYMBOL_10) && Buy10)
{int send19=OrderSend(SYMBOL_10,OP_BUY,NewLot10,NormalizeDouble(MarketInfo(SYMBOL_10,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_10)>0 && NormalizeDouble((MarketInfo(SYMBOL_10,MODE_BID)-Step*D*(MarketInfo(SYMBOL_10,MODE_POINT))), Digits)>=OldPricS(SYMBOL_10) && Sell10)
{int send20=OrderSend(SYMBOL_10,OP_SELL,NewLot10,NormalizeDouble(MarketInfo(SYMBOL_10,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_11)>0 && NormalizeDouble((MarketInfo(SYMBOL_11,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_11,MODE_POINT))), Digits)<=OldPricB(SYMBOL_11) && Buy11)
{int send21=OrderSend(SYMBOL_11,OP_BUY,NewLot11,NormalizeDouble(MarketInfo(SYMBOL_11,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_11)>0 && NormalizeDouble((MarketInfo(SYMBOL_11,MODE_BID)-Step*D*(MarketInfo(SYMBOL_11,MODE_POINT))), Digits)>=OldPricS(SYMBOL_11) && Sell11)
{int send22=OrderSend(SYMBOL_11,OP_SELL,NewLot11,NormalizeDouble(MarketInfo(SYMBOL_11,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_12)>0 && NormalizeDouble((MarketInfo(SYMBOL_12,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_12,MODE_POINT))), Digits)<=OldPricB(SYMBOL_12) && Buy12)
{int send23=OrderSend(SYMBOL_12,OP_BUY,NewLot12,NormalizeDouble(MarketInfo(SYMBOL_12,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_12)>0 && NormalizeDouble((MarketInfo(SYMBOL_12,MODE_BID)-Step*D*(MarketInfo(SYMBOL_12,MODE_POINT))), Digits)>=OldPricS(SYMBOL_12) && Sell12)
{int send24=OrderSend(SYMBOL_12,OP_SELL,NewLot12,NormalizeDouble(MarketInfo(SYMBOL_12,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_13)>0 && NormalizeDouble((MarketInfo(SYMBOL_13,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_13,MODE_POINT))), Digits)<=OldPricB(SYMBOL_13) && Buy13)
{int send25=OrderSend(SYMBOL_13,OP_BUY,NewLot13,NormalizeDouble(MarketInfo(SYMBOL_13,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_13)>0 && NormalizeDouble((MarketInfo(SYMBOL_13,MODE_BID)-Step*D*(MarketInfo(SYMBOL_13,MODE_POINT))), Digits)>=OldPricS(SYMBOL_13) && Sell13)
{int send26=OrderSend(SYMBOL_13,OP_SELL,NewLot13,NormalizeDouble(MarketInfo(SYMBOL_13,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_14)>0 && NormalizeDouble((MarketInfo(SYMBOL_14,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_14,MODE_POINT))), Digits)<=OldPricB(SYMBOL_14) && Buy14)
{int send27=OrderSend(SYMBOL_14,OP_BUY,NewLot14,NormalizeDouble(MarketInfo(SYMBOL_14,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_14)>0 && NormalizeDouble((MarketInfo(SYMBOL_14,MODE_BID)-Step*D*(MarketInfo(SYMBOL_14,MODE_POINT))), Digits)>=OldPricS(SYMBOL_14) && Sell14)
{int send28=OrderSend(SYMBOL_14,OP_SELL,NewLot14,NormalizeDouble(MarketInfo(SYMBOL_14,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_15)>0 && NormalizeDouble((MarketInfo(SYMBOL_15,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_15,MODE_POINT))), Digits)<=OldPricB(SYMBOL_15) && Buy15)
{int send29=OrderSend(SYMBOL_15,OP_BUY,NewLot15,NormalizeDouble(MarketInfo(SYMBOL_15,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_15)>0 && NormalizeDouble((MarketInfo(SYMBOL_15,MODE_BID)-Step*D*(MarketInfo(SYMBOL_15,MODE_POINT))), Digits)>=OldPricS(SYMBOL_15) && Sell15)
{int send30=OrderSend(SYMBOL_15,OP_SELL,NewLot15,NormalizeDouble(MarketInfo(SYMBOL_15,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_16)>0 && NormalizeDouble((MarketInfo(SYMBOL_16,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_16,MODE_POINT))), Digits)<=OldPricB(SYMBOL_16) && Buy16)
{int send31=OrderSend(SYMBOL_16,OP_BUY,NewLot16,NormalizeDouble(MarketInfo(SYMBOL_16,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_16)>0 && NormalizeDouble((MarketInfo(SYMBOL_16,MODE_BID)-Step*D*(MarketInfo(SYMBOL_16,MODE_POINT))), Digits)>=OldPricS(SYMBOL_16) && Sell16)
{int send32=OrderSend(SYMBOL_16,OP_SELL,NewLot16,NormalizeDouble(MarketInfo(SYMBOL_16,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_17)>0 && NormalizeDouble((MarketInfo(SYMBOL_17,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_17,MODE_POINT))), Digits)<=OldPricB(SYMBOL_17) && Buy17)
{int send33=OrderSend(SYMBOL_17,OP_BUY,NewLot17,NormalizeDouble(MarketInfo(SYMBOL_17,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_17)>0 && NormalizeDouble((MarketInfo(SYMBOL_17,MODE_BID)-Step*D*(MarketInfo(SYMBOL_17,MODE_POINT))), Digits)>=OldPricS(SYMBOL_17) && Sell17)
{int send34=OrderSend(SYMBOL_17,OP_SELL,NewLot17,NormalizeDouble(MarketInfo(SYMBOL_17,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_18)>0 && NormalizeDouble((MarketInfo(SYMBOL_18,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_18,MODE_POINT))), Digits)<=OldPricB(SYMBOL_18) && Buy18)
{int send35=OrderSend(SYMBOL_18,OP_BUY,NewLot18,NormalizeDouble(MarketInfo(SYMBOL_18,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_18)>0 && NormalizeDouble((MarketInfo(SYMBOL_18,MODE_BID)-Step*D*(MarketInfo(SYMBOL_18,MODE_POINT))), Digits)>=OldPricS(SYMBOL_18) && Sell18)
{int send36=OrderSend(SYMBOL_18,OP_SELL,NewLot18,NormalizeDouble(MarketInfo(SYMBOL_18,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_19)>0 && NormalizeDouble((MarketInfo(SYMBOL_19,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_19,MODE_POINT))), Digits)<=OldPricB(SYMBOL_19) && Buy19)
{int send37=OrderSend(SYMBOL_19,OP_BUY,NewLot19,NormalizeDouble(MarketInfo(SYMBOL_19,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_19)>0 && NormalizeDouble((MarketInfo(SYMBOL_19,MODE_BID)-Step*D*(MarketInfo(SYMBOL_19,MODE_POINT))), Digits)>=OldPricS(SYMBOL_19) && Sell19)
{int send38=OrderSend(SYMBOL_19,OP_SELL,NewLot19,NormalizeDouble(MarketInfo(SYMBOL_19,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}

if(Count(OP_BUY,SYMBOL_20)>0 && NormalizeDouble((MarketInfo(SYMBOL_20,MODE_ASK)+Step*D*(MarketInfo(SYMBOL_20,MODE_POINT))), Digits)<=OldPricB(SYMBOL_20) && Buy20)
{int send39=OrderSend(SYMBOL_20,OP_BUY,NewLot20,NormalizeDouble(MarketInfo(SYMBOL_20,MODE_ASK), Digits),100,0,0,CommentEA,Magic,0,Green);}
if(Count(OP_SELL,SYMBOL_20)>0 && NormalizeDouble((MarketInfo(SYMBOL_20,MODE_BID)-Step*D*(MarketInfo(SYMBOL_20,MODE_POINT))), Digits)>=OldPricS(SYMBOL_20) && Sell20)
{int send40=OrderSend(SYMBOL_20,OP_SELL,NewLot20,NormalizeDouble(MarketInfo(SYMBOL_20,MODE_BID), Digits),100,0,0,CommentEA,Magic,0,Red);}
}
//--------------------------------------------------------------------+
double ProfProc=(AccountBalance()/100)*(Risk/10);
if((Count(-1,SYMBOL_1)>1 || Count(-1,SYMBOL_2)>1 || Count(-1,SYMBOL_3)>1 || Count(-1,SYMBOL_4)>1 || Count(-1,SYMBOL_5)>1 || Count(-1,SYMBOL_6)>1 || Count(-1,SYMBOL_7)>1 || Count(-1,SYMBOL_8)>1 || Count(-1,SYMBOL_9)>1 || Count(-1,SYMBOL_10)>1 || Count(-1,SYMBOL_11)>1 || Count(-1,SYMBOL_12)>1 || Count(-1,SYMBOL_13)>1 || Count(-1,SYMBOL_14)>1 || Count(-1,SYMBOL_15)>1 || Count(-1,SYMBOL_16)>1 || Count(-1,SYMBOL_17)>1 || Count(-1,SYMBOL_18)>1 || Count(-1,SYMBOL_19)>1 || Count(-1,SYMBOL_20)>1) &&
Profit(-1)>=ProfProc && ProfProc!=0)
{CloserB(); CloserS();}

double ProfProc2=(AccountBalance()/100)*Risk;
if(Profit(-1)>=ProfProc2 && ProfProc2!=0)
{CloserB(); CloserS();}

double StopProc=(AccountBalance()/100)*StopProcent*(-1);

if(Profit(-1)<StopProc && StopProcent!=0)
{CloserB(); CloserS();}
//--------------------------------------------------------------------+
return(0);}
//--------------------------茵彘腓磴 耱铒------------------------------+
void Trail(int _key, string sy)
{double _bid, _ask, _point;
if(Tral!=0)
{for(int i=0; i<OrdersTotal(); i++)
{if (OrderSelect(i,SELECT_BY_POS) && OrderSymbol()==sy && OrderMagicNumber()==_key)
{_point=MarketInfo(OrderSymbol(), MODE_POINT);
if (OrderType()==OP_BUY)
{_bid=MarketInfo(OrderSymbol(), MODE_BID);
if(_bid>MathMax(OrderOpenPrice(),OrderStopLoss())+(Tral+TralStep)*_point*D)
{mod=OrderModify(OrderTicket(),OrderOpenPrice(),_bid-Tral*_point*D,OrderTakeProfit(),0);}}
if (OrderType()==OP_SELL)
{_ask=MarketInfo(OrderSymbol(), MODE_ASK);
if((_ask<MathMin(OrderOpenPrice(),OrderStopLoss())-(Tral+TralStep)*_point*D && OrderStopLoss()!=0)||(_ask<OrderOpenPrice()-(Tral+TralStep)*_point*D && OrderStopLoss()==0))
{mod=OrderModify(OrderTicket(),OrderOpenPrice(),_ask+Tral*_point*D,OrderTakeProfit(),0);}}}}}
return;}
//--------------------------------------------------------------------+
int Count(int type,string sy)
{int count=0;
for(int i=OrdersTotal()-1;i>=0;i--){
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{if(sy==OrderSymbol() && OrderMagicNumber()==Magic && (type==-1 || OrderType()==type)) count++;}}
return(count);}
//--------------------------------------------------------------------+
double Profit(int type)
{double Profit = 0;
for (int cnt = OrdersTotal() - 1; cnt >= 0; cnt--) {
if(OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES))
{if (OrderMagicNumber()==Magic && (OrderType() == type || type==-1)) Profit += OrderProfit()+OrderSwap()+OrderCommission();}}
return (Profit);}
//--------------------------------------------------------------------+
void CloserS()
{for(int i=OrdersTotal()-1;i>=0;i--)
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{if(OrderMagicNumber()==Magic && OrderType()==OP_SELL)
bool sel8=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(MarketInfo(OrderSymbol(),MODE_ASK), Digits),1000,0);}}

void CloserB()
{for(int i=OrdersTotal()-1;i>=0;i--)
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{if(OrderMagicNumber()==Magic && OrderType()==OP_BUY)
bool sel9=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(MarketInfo(OrderSymbol(),MODE_BID), Digits),1000,0);}}
//--------------------------------------------------------------------+
double OldPricB(string sy)
{double oldorderopenpriceB;
int oldticketnumberB;
double unusedB = 0;
int ticketnumberB = 0;
for (int cnt = OrdersTotal() - 1; cnt >= 0; cnt--)
{if(OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES))
{if (OrderSymbol() == sy && OrderType() == OP_BUY && OrderMagicNumber()==Magic)
{oldticketnumberB = OrderTicket();
if (oldticketnumberB > ticketnumberB)
{ticketnumberB = oldticketnumberB;
oldorderopenpriceB = OrderOpenPrice();
unusedB = oldorderopenpriceB;}}}}
return (oldorderopenpriceB);}
//--------------------------------------------------------------------+
double OldPricS(string sy)
{double oldorderopenpriceS;
int oldticketnumberS;
double unusedS = 0;
int ticketnumberS = 0;
for (int cnt = OrdersTotal() - 1; cnt >= 0; cnt--)
{if(OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES))
{if (OrderSymbol() == sy && OrderType() == OP_SELL && OrderMagicNumber()==Magic)
{oldticketnumberS = OrderTicket();
if (oldticketnumberS > ticketnumberS)
{ticketnumberS = oldticketnumberS;
oldorderopenpriceS = OrderOpenPrice();
unusedS = oldorderopenpriceS;}}}}
return (oldorderopenpriceS);}

相关资源

暂无评论

暂无评论...