need help to fix 3 errors in code (MT4)

vladchomps

Newbie
Jun 4, 2022
2
0
1
49
hey guys, can you pls help me fix this code. It gives me 3 errors and I have no clue how to fix it. This is not my code and I'm not a programmer. This is to close all loss orders at specific level. Grearty appreciated.

MQL4:
#property description "closes all orders upon going beyond the loss threshold,"
#property description "the loss value should be expressed in absolute value"
#property description "if the absolute value of loss is greater than the absolute value of order profit,"
#property description "the order would be deleted"
 
#include <order_exit.mqh>
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
input double order_loss=10.0; //order loss (absolute value)
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   while(closeAllLoss()){}
  }
//+------------------------------------------------------------------+
bool closeAllLoss()
  {
   int not_closed=0;
   int total= OrdersTotal();
   for(int i=total-1;i>=0;i--)
      if(!exitOrders(i,SELECT_BY_POS,true,-1,NULL,order_loss,-1))
         not_closed++;
   return(not_closed);
  }
//+------------------------------------------------------------------+
 
//+------------------------------------------------------------------+




errors:

can't open "C:\Users\chomp\AppData\Roaming\MetaQuotes\Terminal\2C68BEE3A904BDCEE3EEF5A5A77EC162\MQL4\Include\order_exit.mqh" include file closeall_loss.mq4

'ALL_MARKET' - undeclared identifier closeall_loss.mq4
'exitOrders' - function not defined closeall_loss.mq4
 

Attachments

  • closeall_loss.mq4
    1.8 KB · Views: 3
Last edited by a moderator: