Questions from Beginners MQL5 MT5 MetaTrader 5 - page 542

 
Karputov Vladimir:

Then what was it created for?
 
MASTERXAYS:
Then what was it designed for?
Briefly: You can, and should, use an ordinary terminal. Full stop.
 
Karputov Vladimir:
Briefly: You can, and should, use an ordinary terminal. Full stop.
Ahhhhhh I get it, banana. That's it then, I'm out. :-))))
 

Good afternoon.

I have an EA which has a user-defined function inside of it. Its inputs are MqlRates and some variables which are calculated in the EA. The output is a number of uint type. Several indicators are calculated during the function (they are only in the function, not in Expert Advisor) and there is a big loop in the loop. At the end of the function all indicators are released through IndicatorRelease. When the Expert Advisor works in real time, there are no problems, although the CPU is loaded at 100% for a couple of minutes, due to the mass of simple calculations and accesses to the arrays (that exist only in the function). However, if we run the Expert Advisor in the strategy tester, it will exit before it even starts and the tester log will contain many lines 16xxxxxxx bytes not avalibale. Probably, it happens because of the intermediate results of the function operation. Here is my question: what should I do to make sure that at the end of its operation only return()-result will remain in memory and nothing else?

Thanks already.

 

Guys,

come across 4sessions in mql5?

https://www.mql5.com/ru/code/download/10513/4Sessions.mq4

Upd.

Translation of the functions can be found here:

https://www.mql5.com/ru/articles/81

 
Stairway_2_7:

Guys,

come across 4sessions in mql5?

https://www.mql5.com/ru/code/download/10513/4Sessions.mq4

Upd.

Translation of the functions can be found here:

https://www.mql5.com/ru/articles/81

Did you get banned from the search engine?

https://www.mql5.com/ru/code/962

DaysOfWeekCheck
DaysOfWeekCheck
  • votes: 24
  • 2012.08.12
  • Nikolay Kositsin
  • www.mql5.com
Функция для определения нерабочих дней на сервере. Она будет интересна прежде всего тем, кто использует в своих экспертах для обработки событий функцию OnTimer().
 

pako,

Thanks for the link, I want a complicated code, specifically 4sessions.

Forum search is peculiar, I'm getting the hang of it :)

 

Can you tell me why orders are not opening and level 50 is not reflected in the visualisation?

void OnTick()
  {
   int kolpos=0;
   double rsi=0,uroven70=70,uroven30=30,uroven50=50;
   rsi=iRSI(Symbol(),0,10,PRICE_CLOSE,1);
   for(int pos=0; pos<OrdersTotal(); pos++) 
     {
      OrderSelect(pos,SELECT_BY_POS,MODE_TRADES);
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
         kolpos++;
     }
   if(kolpos==0)
     {
      if((rsi>uroven70) && (Close[1]>uroven70) && (Open[1]<uroven70) && Volume[0]<3)
         OrderSend(Symbol(),OP_BUY,Lots,Ask,30,0,0,"",Magic,0,clrGreen);
      if((rsi<uroven30) && (Close[1]<uroven30) && (Open[1]>uroven30) && Volume[0]<3)
         OrderSend(Symbol(),OP_SELL,Lots,Bid,30,0,0,"",Magic,0,clrRed);
     }
 }
 
edutak:

Can you please tell me why orders are not opening and level 50 is not reflected in the visualisation?

You have a logical error. Close[1]>uroven70 But uroven70 equals 70. The only way to get such a price is to use USDJPY.

 
Vitalii Ananev:

You have logical mistakes. Close[1]>uroven70 And uroven70 equals 70. This price could be only on USDJPY.

Sorry, I don't really understand. The close price of the candle should be higher than the indicator's 70 level.

The 70 level is equal to 70. What should it be equal to?

Reason: