//+------------------------------------+ //| TRUE_SCALPER | //+------------------------------------+ // Designed for 5 but I attached it to 15 and it worked fine. // long if EMA3>EMA7:::EMA370) RSIPOS=true; else RSINEG=false; if(RSI<30) RSIPOS=false; else RSINEG=true; OrdersPerSymbol=0; for(cnt=OrdersTotal();cnt>=0;cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if( OrderSymbol()==Symbol() ) { OrdersPerSymbol++; } } // calculate TakeProfit and StopLoss for //(B)id (sell, short) and (A)sk(buy, long) lobar=Low[Lowest(Symbol(),0,MODE_LOW,19,1)]; hibar=High[Highest(Symbol(),MODE_HIGH,19,1)]; //slBUY=Ask-(StopLoss*p); slBUY=lobar-p; tpBUY=Bid+(TakeProfit*p); //slSEL=Bid+(StopLoss*p); slSEL=hibar+p; tpSEL=Ask-(TakeProfit*p); // so we can eventually do trailing stop //if (TakeProfit<=0) {tpBUY=0; tpSEL=0;} //if (StopLoss<=0) {slBUY=0; slSEL=0;} // place new orders based on direction // only of no orders open if(OrdersPerSymbol<1) { // not sure if this should be POS or NEG if(bull>bear && RSINEG) { OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,slBUY,tpBUY,"ZJMQCIDFG",11123,0,White); return(0); } // not sure if this should be POS or NEG if(bull=0;cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if( OrderSymbol()==Symbol() ) { if(OrderType()==OP_BUY) { // did we make our desired profit? if( Bid-OrderOpenPrice() > ProfitMade*p ) { OrderClose(OrderTicket(),Lots,Bid,0,White); return(0); } // BUY order in a bear market so close if(bull (ProfitMade*p) ) { OrderClose(OrderTicket(),Lots,Ask,0,Red); return(0); } // SELL order in a bull market so close if(bull>bear) { OrderClose(OrderTicket(),Lots,Ask,0,Red); return(0); } } //if SELL } // if(OrderSymbol) } // for return(0); } // start()