Expert doesn't perform any trades! - page 2

 
lippmaje:

Why don't you simply debug your code instead of asking unanswerable questions. No one here knows about your broker and how they set up your account.

i have already done that before posting here , it works fine on backtest but doesn't perform trades on live demo account 

 
andrw11: doesn't perform trades on live demo account 

Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?

 
William Roeder:

Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?

i don't expect you to do that! i have already done that before posting here . code is running fine with NO errors , that's why i posted since i can't find an error to fix 

 
andrw11: i don't expect you to do that! i have already done that before posting here 

So where is the log of your printout?

 
William Roeder:

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, account information and prices are valid.
Maybe sleep in OnInit untill TERMINAL_IS_CONNECTED?
 
andrw11:

i don't expect you to do that! i have already done that before posting here . code is running fine with NO errors , that's why i posted since i can't find an error to fix 

If you believe you don't have a bug, why did you post here? Post your whole code to get help, not just a part that you believe is running fine