//+------------------------------------+
//| TRUE_SCALPER |
//+------------------------------------+
// Designed for 5 but I attached it to 15 and it worked fine.
// long if EMA3>EMA7:::EMA350
if(RSI>50) RSIPOS=true; else RSIPOS=false;
if(RSI<50) RSINEG=false; else RSIPOS=true;
lobar=Low[Lowest(MODE_LOW,19,19)];
highbar=High[Highest(MODE_HIGH,19,19)];
OrdersPerSymbol=0;
for(cnt=OrdersTotal();cnt>=0;cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if( OrderSymbol()==Symbol() )
{
OrdersPerSymbol++;
}
}
// place new orders based on direction
if(OrdersPerSymbol<1)
{
if(bull>bear && RSINEG)
{
sl=lobar-1*p; //(ask-(StopLoss*point));
tp=(Bid+(TakeProfit*p));
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,sl,tp,"ZJMQCIDFG",11123,0,White);
return(0);
}
if(bull=0;cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if( OrderSymbol()==Symbol() )
{
if(OrderType()==OP_BUY)
{
if( Bid-OrderOpenPrice() > (ProfitMade*p) )
{
OrderClose(OrderTicket(),Lots,Bid,0,White);
return(0);
}
}
if(OrderType()==OP_SELL)
{
if( OrderOpenPrice()-Ask > (ProfitMade*p) )
{
OrderClose(OrderTicket(),Lots,Ask,0,Red);
return(0);
}
}
}
}
// See if the direction changed, and close if so
for(cnt=OrdersTotal();cnt>=0;cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if( OrderSymbol()==Symbol() )
{
if(OrderType()==OP_BUY)
{
if(bullbear)
{
OrderClose(OrderTicket(),Lots,Ask,0,Red);
return(0);
}
}
}
}
return(0);
}