//+------------------------------------------------------------------+ //| CCFp(advisor).mq4 | //| m_a_sim@mail.ru - Simakov Mikhail| //| http://www.mql4.com/ru/users/m_a_sim | //+------------------------------------------------------------------+ #property copyright "m_a_sim@mail.ru - Simakov Mikhail" #property link "http://www.mql4.com/ru/users/m_a_sim" //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ extern int MA_Method=1; extern int Price=0; extern int Fast=3; extern int Slow=5; extern int sl=200; extern double lot=0.1; extern int magicMAX=101; extern int magicMIN=201; int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int bar; double H,A0,A1,A2; int MAX,MIN,MAX1,MIN1; double maxd,mind; int start() { //---- int i, j,jj,ticket,simMAX,simMIN; //if (bar!=Bars ){ MAX=0; MIN=0; maxd=iCustom(NULL,0,"CCFp",MA_Method,Price,Fast,Slow,0,1); mind=iCustom(NULL,0,"CCFp",MA_Method,Price,Fast,Slow,0,1); for (i=0;i<=7;i++){ if (maxdiCustom(NULL,0,"CCFp",MA_Method,Price,Fast,Slow,i,1)) {mind=iCustom(NULL,0,"CCFp",MA_Method,Price,Fast,Slow,i,1); MIN=i; } } MAX1=0; MIN1=0; for (i=0;i<=7;i++){ if (iCustom(NULL,0,"CCFp",MA_Method,Price,Fast,Slow,MAX,2)iCustom(NULL,0,"CCFp",MA_Method,Price,Fast,Slow,i,2)) {MIN1=1;} } //bar=Bars; //} Comment(MAX," ",MIN); //MAX===================================== jj=0; if (OrdersTotal()>0){ for(i=0;i0){ for(i=0;i0){ for(i=0;i0){ for(i=0;i0){ for(i=0;i