Experts: ManualTradeOnStrategyTester - page 2

 

Nice and Perfect. Excel works fine.
BUT after 2days coming this spamming message

 2016.08.16 16:19:08.052 2016.01.04 00:25:00   EA detected error: 1004 -- EA Aborted!!! Pls. close EA now and attend to your open entry/ies.

that block orders

HELP!


 
Andrasdudu:

Nice and Perfect. Excel works fine.
BUT after 2days coming this spamming message

 2016.08.16 16:19:08.052 2016.01.04 00:25:00   EA detected error: 1004 -- EA Aborted!!! Pls. close EA now and attend to your open entry/ies.

that block orders

HELP!


The error you recieved came up when the EA recieved a command order from your Excel button... somehow your EA weren't able to execute the order, "Order Not Sent" message should have appeared too:

//+------------------------------------+
//| Execute TRADE                      |
//+------------------------------------+  
bool ExecuteTrade(string Entry,double ThePrice,double lot) // Entry = buy or sell / returns true if successfull.
  {
   bool success;

   success=true;

   MqlTradeRequest mreq; // for trade send request.
   MqlTradeResult mresu; // get trade result.
   ZeroMemory(mreq); // Initialize trade send request.

   Print("Order Initialized");
   mreq.action = TRADE_ACTION_DEAL;                                   // immediate order execution
   if(Entry=="buy") mreq.price = NormalizeDouble(ThePrice,_Digits);   // should be latest bid price
   if(Entry=="sell") mreq.price = NormalizeDouble(ThePrice,_Digits);  // should be latest ask price
   mreq.symbol = _Symbol;                                             // currency pair
   mreq.volume = lot;                                                 // number of lots to trade
   mreq.magic = 11119;                                                // Order Magic Number
   if(Entry=="sell") mreq.type = ORDER_TYPE_SELL;                     // Sell Order
   if(Entry=="buy") mreq.type = ORDER_TYPE_BUY;                       // Buy Order
   mreq.type_filling = ORDER_FILLING_FOK;                             // Order execution type
   mreq.deviation=100;                                                // Deviation from current price
//--- send order
   if(!OrderSend(mreq,mresu))
     {
      Alert("Order Not Sent: ",GetLastError());
      ResetLastError();
      success=false;
     }
.
.
.
.
   if(success==false)
     {
      Alert("Error ORDER FAILED!!! - error:1004");
      Arun_error=1004;
     }
   return(success);
  }

... not sure what went wrong on your process... but the only cause of the error I could think of is something on your MT5 setup ...or ... on the source command folder where you sent the command files text, probably a text command aren't deleted properly after being used or told so by the EA.  Check that command source "common" folder if it responds properly on your excel and of that EA... if it does then there gotta be something in your MT5 strategy tester that cannot detect the order requested.

 

Hello there, thanks for the Expert Advisor.

When I hit start on the strategy tester the Visualizer opens and shows a big "Waiting for update"  message and nothing happens.

How can I solve this?


Thanks..

 


Hi,

i tried to use this Indicator too, but i got the same Message.

Log write:

1. 2020.04.18 21:14:44.766 strategytesterpracticetrade is not custom indicator and will be removed

2. 2020.04.18 21:14:44.766 cannot create indicator


Can anybody solve this Problem?

 


Ok, the solution is (see the Picture).

Mouse-Right Click on ExpertMACD to open up the Context Menü in Navigator-> select "Testen" or "Test".



But now i have another problem.


If there is a .txt File named "sell.txt", "buy.txt" or "close.txt" located on

Win10:

C:\Users\[User]\AppData\Roaming\MetaQuotes\Terminal\Common\Files

MT5 open every time a new Order! It dosent close an Order if there is a close.txt located on the Path.

I think the Problem i here in the Code:


// if a close.txt is found, this will close any open position with the maximum volume size stated on the position. 
   if(FileIsExist("close.txt",FILE_COMMON))
     {

      FileDelete("sell.txt",FILE_COMMON);
      FileDelete("buy.txt",FILE_COMMON);
      FileDelete("close.txt",FILE_COMMON);

      if(OpenPosition()=="buy")
        {
         PositionSelect(_Symbol);
         JustifySize=NormalizeDouble(PositionGetDouble(POSITION_VOLUME),2);
         ExecuteTrade("sell",CurP,JustifySize);
        }

      if(OpenPosition()=="sell")
        {
         PositionSelect(_Symbol);
         JustifySize=NormalizeDouble(PositionGetDouble(POSITION_VOLUME),2);
         ExecuteTrade("buy",CurP,JustifySize);
        }
     }


It appears that MT5 is reacting differently on this line than desired

if(OpenPosition()=="buy")

Files:
pic.jpg  98 kb
 
I got this message EA aborted !
Files:
the_PR.png  38 kb
 
Hello good time
Possibility to send this app or excel file to me
Because I don't do anything