Error 148

To add comments, please log in or register
Chaiya Srisawat
Chaiya Srisawat  

Hello, I have a question with error 148.

I checked the max pending with this code.

int max_allowed_orders=(int)AccountInfoInteger(ACCOUNT_LIMIT_ORDERS);

Some time results =0; What is the meaning? Is it mean no pending allow?  But when I send manually pending order to the account, it is successful.

So I think this may mean that the number of pending order is not be control!!

What is the real meaning of ACCOUNT_LIMIT_ORDERS? Please help!!


William Roeder
William Roeder  
Chaiya Srisawat: Some time results =0; What is the meaning?
  1. Perhaps you should read the manual.
    ACCOUNT_LIMIT_ORDERS Maximum allowed number of open positions and active pending orders (in total), 0 — unlimited int

              Account Properties - Environment State - Standard Constants, Enumerations and Structures - MQL4 Reference

  2. Do you really expect us to understand your code without it's context, like when you call it? (probably at № 2.3 not № 2.7)
    Don't try to use any price or server related functions in OnInit (or on load,) as there may be no connection/chart yet:
    1. Terminal starts.
    2. Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
    3. OnInit is called.
    4. For indicators OnCalculate is called with any existing history.
    5. Human may have to enter password, connection to server begins.
    6. New history is received, OnCalculate called again.
    7. New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent and prices are valid.

To add comments, please log in or register