Why this simple expert goes on lose? When is downtrent ;) New comment persy5 2013.05.27 16:03 //+------------------------------------------------------------------+ //| 3.mq5 | //| Copyright 2013, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2013, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property version "1.00" //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ #include <Trade/Trade.mqh> #include <Trade/PositionInfo.mqh> #include <Trade/OrderInfo.mqh> CTrade m_Trade; CPositionInfo m_Position; COrderInfo m_Order; int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- if( !(PositionsTotal() || OrdersTotal())){ double xxx = SymbolInfoDouble(_Symbol,SYMBOL_BID); m_Trade.Sell(0.1,_Symbol,xxx,xxx+0.001,xxx-0.001); } } //+------------------------------------------------------------------+ //| Tester function | //+------------------------------------------------------------------+ double OnTester() { //--- double ret=0.0; //--- //--- return(ret); } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { //--- } //+------------------------------------------------------------------+ Alain Verleyen 2013.05.27 20:00 #1 persy5: Because your SL is hit before your TP more often than reverse. New comment