modelling quality n/a ?? - page 2

 
yilmazkahya:

thank you ubzen

n thank you raptoruk of course :)

i m learning this metatrader subjects slowly. i m bad at english and i m sorry for these.

this forum help me everytime.

Your English is good . . .

Do you test return values from your trading functions and report errors to the log ?

More info: What are Function return values ? How do I use them ?

 
deVries:


it can be you have ECN broker and your code is trying opening buy or sell trades with directly stoploss setting

or it only open trades if OrdersTotal() == 0, or there was simply no signal today for opening new trade

or the slippage is too low and it only tries to open at first tick every new bar


i use ordermodify and it isn't about ecn type,

i use orderstotal<1 (but i did this mistake several times in past :D )

it's not about slippage i think it's about history data.

i try explain something (raptoruk's message reply)

i don't know what's happening :S

 
yilmazkahya:


i know these a little. but the problem is that ;

eurjpy/usdjpy = eur/usd than

eurjpy/usdjpy = a (ex. 1.38800)

eur/usd=b (ex 1.38750)

if a>=b+4 and buy eur/usd take profit 4 pips. this ea in back test very profitable and modelling quality 90% . but in real ea isn't open an order.

if a>=b then ea open orders (ex. a= 1.38800, b = 1.38799) and it's not profitable.

if it's wrong why modelling quality 90% and it's profitable,

if it's true why it can't open an order in real time ??

Because your code has a bug or more than one bug . . .
 
i don't understand :S
 
yilmazkahya: i don't understand :S
Do some Debugging. Check your Error_Logs.
 
yilmazkahya:


i use orderstotal<1 (but i did this mistake several times in past :D )


It makes no difference if the code is ( MACD Sample )

   total=OrdersTotal();
   if(total<1) 
     {
      // no opened orders identified
      if(AccountFreeMargin()<(1000*Lots))
        {
         Print("We have no money. Free Margin = ", AccountFreeMargin());
         return(0);  
        }
      // check for long position (BUY) possibility
      if(MacdCurrent<0 && MacdCurrent>SignalCurrent && MacdPrevious<SignalPrevious &&
         MathAbs(MacdCurrent)>(MACDOpenLevel*Point) && MaCurrent>MaPrevious)
        {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"macd sample",16384,0,Green);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
           }
         else Print("Error opening BUY order : ",GetLastError()); 
         return(0); 
        }
      // check for short position (SELL) possibility
      if(MacdCurrent>0 && MacdCurrent<SignalCurrent && MacdPrevious>SignalPrevious && 
         MacdCurrent>(MACDOpenLevel*Point) && MaCurrent<MaPrevious)
        {
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"macd sample",16384,0,Red);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
           }
         else Print("Error opening SELL order : ",GetLastError()); 
         return(0); 
        }
      return(0);
     }

or your code is

   total=OrdersTotal();
   if(total == 0) 
     {
      // no opened orders identified
      if(AccountFreeMargin()<(1000*Lots))
        {
         Print("We have no money. Free Margin = ", AccountFreeMargin());
         return(0);  
        }
      // check for long position (BUY) possibility
      if(MacdCurrent<0 && MacdCurrent>SignalCurrent && MacdPrevious<SignalPrevious &&
         MathAbs(MacdCurrent)>(MACDOpenLevel*Point) && MaCurrent>MaPrevious)
        {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"macd sample",16384,0,Green);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
           }
         else Print("Error opening BUY order : ",GetLastError()); 
         return(0); 
        }
      // check for short position (SELL) possibility
      if(MacdCurrent>0 && MacdCurrent<SignalCurrent && MacdPrevious>SignalPrevious && 
         MacdCurrent>(MACDOpenLevel*Point) && MaCurrent<MaPrevious)
        {
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"macd sample",16384,0,Red);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
           }
         else Print("Error opening SELL order : ",GetLastError()); 
         return(0); 
        }
      return(0);
     }

So what is orderstotal in your code ??

 
deVries:


It makes no difference if the code is ( MACD Sample )

or your code is

So what is orderstotal in your code ??


modelling quality is n/a because i used iOpen. i change it n the problem is solved. thank you deVries.
Reason: