Is it different to run Expert in Real Account and Demo Account?

 

Hi

I wrote the Expert for Auto trading.(mql4) It goes very well in demo account.

I tested multi times, without any problem.

BUT when i want to use it on real account, it does not working... :(
WHY?

I checked everything : SL,Tp, Slippage ,..... .

All parameters,All numbers , and ...... are true. But i do not know why is not working on Real Account.

 what is wrong? slippage? Ask? bid?   

which one??

Can anyone help me?

Here the code :   

 int buyy;
 int OnInit()
  {         
       buyy=OrderSend(Symbol(),OP_BUY,0.01,Ask,2,Ask-5,0,"Buy",001,0,clrGreen);
       
       Comment("buy: ",buyy)
   return(INIT_SUCCEEDED);
  }
 
zeusjoon:

Hi

I wrote the Expert for Auto trading.(mql4) It goes very well in demo account.

I tested multi times, without any problem.

BUT when i want to use it on real account, it does not working... :(
WHY?

I checked everything : SL,Tp, Slippage ,..... .

All parameters,All numbers , and ...... are true. But i do not know why is not working on Real Account.

 what is wrong? slippage? Ask? bid?   

which one??

Can anyone help me?

Here the code :   

Hello, did you try to Optimize your lot size maybe? or you can check on the expert message, maybe something wrong there
 
       buyy=OrderSend(Symbol(),OP_BUY,0.01,Ask,2,Ask-5,0,"Buy",001,0,clrGreen);
  1. Check your return codes, and report your errors.

    Don't look at GLE/LE unless you have an error. Don't just silence the compiler, it is trying to help you.
              What are Function return values ? How do I use them ? - MQL4 programming forum
              Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

  2. You buy at the Ask and sell at the Bid.
    1. Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using the Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?

    2. Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger at a specific Bid price, add the average spread.
                MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25

    3. The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)
      Most brokers with variable spread widen considerably at end of day (5 PM ET) ± 30 minutes. My GBPJPY (OANDA) shows average spread = 26 points, but average maximum spread = 134.
  3. You can't move stops (or pending prices) closer to the market than the minimum: MODE_STOPLEVEL * _Point or SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL).
              Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial

    On some ECN type brokers the value might be zero (broker doesn't know.) Use a minimum of two (2) PIPs.

  4. What is Ask? On EURUSD it would be 1.1234º and subtracting 5 would be negative. № 1, № 2, № 3.
 
William Roeder:
  1. Check your return codes, and report your errors.

    Don't look at GLE/LE unless you have an error. Don't just silence the compiler, it is trying to help you.
              What are Function return values ? How do I use them ? - MQL4 programming forum
              Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

  2. You buy at the Ask and sell at the Bid.
    1. Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using the Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?

    2. Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger at a specific Bid price, add the average spread.
                MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25

    3. The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)
      Most brokers with variable spread widen considerably at end of day (5 PM ET) ± 30 minutes. My GBPJPY (OANDA) shows average spread = 26 points, but average maximum spread = 134.
  3. You can't move stops (or pending prices) closer to the market than the minimum: MODE_STOPLEVEL * _Point or SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL).
              Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial

    On some ECN type brokers the value might be zero (broker doesn't know.) Use a minimum of two (2) PIPs.

  4. What is Ask? On EURUSD it would be 1.1234º and subtracting 5 would be negative. № 1, № 2, № 3.
Thanks I will check it.