/* +--------+ |CCIGrab | +--------+ Theory of operation =================== +-100 in 2 or 3 bars, then order in proper direction small losslimit, large profitmade TIME FRAME ========== whatever works best PAIRS ===== EURUSD ENTRY LONG ========== CCI < -100 to CCI > +100 ENTRY SHORT =========== CCI > +100 to CCI < -100 EXIT ==== ProfitMade (optimized by month) MONEY MANAGEMENT ================ none RISK MANAGEMENT =============== none FAILURE MANAGEMENT ================== GetLastError on every transaction VERSION HISTORY =============== 00 - initial concept 01 - */ // variables declared here are GLOBAL in scope #property copyright "Ron Thompson" #property link "http://www.lightpatch.com/forex" // user input extern double Lots=0.1; extern int Slippage=2; extern double ProfitMade=42; extern double LossLimit=95; extern int cciperiod=2; extern int cciprice=3; //typical extern int ccilevel=30; extern double TrailStop=999; extern int PLBreakEven=999; // naming and numbering int MagicNumber = 200601291336; string TradeComment = "CCIGrab_00_"; // Bar handling datetime bartime=0; int bartick=0; int objtick=0; // Trade control bool TradeAllowed=true; // GlobalVariableCheck(static) counter // for number of basket closes int maxDrawDown=0; int maxOrderOpen=0; //+-------------+ //| Custom init | //|-------------+ // Called ONCE when EA is added to chart or recompiled int init() { int i; //remove the old objects for(i=0; i