/* +--------+ |Divergence Trader -- v11 has no divergence. How 'bout that! +--------+ */ #property copyright "Ron Thompson" #property link "http://www.lightpatch.com/forex" // user input extern double Lots=0.01; // how many lots to trade at a time extern int MA_Period=88; extern int MA_Price = PRICE_OPEN; extern int MA_Mode = MODE_EMA; extern double ProfitMade=20; // how much money do you expect to make extern double LossLimit=115; // how much loss can you tolorate //extern int BasketProfit=10; // if equity reaches this level, close trades //extern int BasketLoss=9999; // if equity reaches this negative level, close trades extern int PLBreakEven=9999; // set break even when this many pips are made (999=off) int Slippage=2; // how many pips of slippage can you tolorate // naming and numbering int MagicNumber = 200601182020; // allows multiple experts to trade on same account string TradeComment = "Divergence_07_"; // Bar handling datetime bartime=0; // used to determine when a bar has moved int bartick=0; // number of times bars have moved int objtick=0; // used to draw objects on the chart int tickcount=0; // Trade control bool TradeAllowed=true; // used to manage trades //+-------------+ //| Custom init | //|-------------+ // Called ONCE when EA is added to chart or recompiled int init() { int i; string o; //remove the old objects for(i=0; i=0;cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if( OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber) { OrdersPerSymbol++; } } //+-----------------------------+ //| Insert your indicator here | //| And set either BUYme or | //| SELLme true to place orders | //+-----------------------------+ // high and low of [1] and open of [0] either above or below the MA maHI=High[1]; maLO=Low[1]; maOPEN=Open[0]; ma0=iMA(Symbol(),0,MA_Period,0,MA_Mode,MA_Price,0); if(maHI>ma0 && maLO>ma0 && maOPEN>ma0) BUYme=true; if(maHI