Questions from Beginners MQL5 MT5 MetaTrader 5 - page 549

 
edutak:
Confused

In what?

void OnTick()
{
 .....
 int Count = CountOrder(Symbol(),Magik);
 if (Count==0)
 {
  //
  ....
 }
 ......
}


int CountOrder(string Smb,int Magik)
{
   int Total = OrdersTotal();
   if (Total==0) return(0);
   int kolpos = 0;
   for(int pos=Total-1; pos>=0; pos--)         
   {
      if(!OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)) continue;
      if(OrderSymbol()==Smb && OrderMagicNumber()==Magik)  kolpos++;
   }
   return(kolpos);
} 

Is that clearer?

 
Vitalii Ananev:

In what?

Is that clearer?

Yes, thank you. Generally understood, it's necessary to work correctly on a real account. Is that correct?

But I have an error somewhere in the logic of closing orders.

 
If I opened an order based on a signal from two indicators, should I also close it using two indicators? Logically, one is enough for me.
 
edutak:
If I opened an order based on two indicators' signals, should I close it using two indicators? Logically, one is sufficient for me.

No, you can open on a coin and close on lunar cycles. It all depends on logic!

I advise you to read Sergei Kovalev's book. Many things will become clearer at once. And many questions will disappear on their own.

 
edutak:
If I open an order by the signal of two indicators, should I also close it by two indicators? Logically, one is enough for me.
This is up to you to decide which signals to use. I am not a psychic and I do not know your logic.
 
edutak:

Yes, thank you. I see, I need it to work correctly in a real account. Is it correct?

But I have an error, somewhere in the logic of closing orders.

I cannot help here without seeing your secret code :)
 
He's not a secret, he's just a survivor. Now I want to make it profitable.
 
edutak:
It's not a secret, it just turned out to be notorious. Now I want to make it profitable.

I would first learn the basics of programming before thinking about profit.

...

When testing, try to put a spread not current but say 3 pips or 30 pips if it's a five-digit spread. And run it on a longer period of history.

 
Vitalii Ananev:
I would learn the basics of programming first before thinking about profit.
Trying.
 
In MT4 I used the very convenient feature of inserting the RSI indicator into the Stochastik indicator. It was more clear perception of market movements and trends compared to the separate arrangement of indicators on the chart. I am now looking for the same opportunity in MT5, but so far without results...
Please tell me about the mechanism of indicators insertion one into another on the chart of MT5 system ?
THANK YOU.
Reason: