Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 912

 
Alexandr Sokolov:

What isDebugger?


If I copy this word into the MQL search engine, it does not find anything, and everything is in English and I do not understand what I need.

Debug is debugging.

The green button next to it is debugging with current real data.

More details in the help


 
Alexey Viktorov:

Debug is debugging.

The green button next to it is debugging on current real data.

See help for details.


Thank you

 
Taras Slobodyanik:

why is there a 1 and not a 0?

Of course there's a time lag because of the weekend.

I don't know, I copied that part of the code in its entirety from the reply.

Thanks for the tip.

 
Do you guys have a function for mql4 that allows you to update the quotes archive? If you drop the robot on a chart, and some quotes are not all loaded on the chart or have been deleted, is it possible to update it with the help of some functions?
 
Seric29:
If you drop the robot to a chart and some quotes are not all downloaded or some quotes are deleted, is it possible to update the quotes archive with the help of some functions?

search KB for "history paging" - there were, but read the description, in MT4 you cannot check programmatically that the history has already been paged, basically you just have to wait

 

Gentlemen - please help. There is a function to calculate the lot on a martin for the next entry, understandably increased by the martin coefficient:

double LOT()
{
   int n=0;
   double OL=Lot;
   for (int j = OrdersHistoryTotal()-1; j >= 0; j--)
   {
      if (OrderSelect(j, SELECT_BY_POS,MODE_HISTORY))
      {
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic)
         {
            if (OrderProfit()<0) 
            {
               if (n==0) OL=NormalizeDouble(OrderLots()*K_Martin,DigitsLot);
               n++;
               if (n>=OrdersClose) {Comment("1");return(Lot);}
            }
            else
            {
               if (n==0) {Comment("2");return(Lot);}
               else {Comment("3");return(OL);}
            }
         }
      }
   }
   return(OL);
}
//------------------------------------------------------------------

we need to add here the calculation of the ACTUAL STOP LOSS as the next Fibo number using the formulaFi= Fi-1 + Fi-2 .

I know the approach. I would like to know where to save the values of the previous losing order and the previous losing order in what variables to avoid deleting them when launching the start expa function.

If I take their values by analogy (like this fi lction takes the values of the next LOT through the previous one in the history) from the calculated stop loss again converting them into pure SL points, it would be too much trouble - I should take them more elegantly...

------

If we do it directly, then when n=0, SL0 = modulo difference (for buy and sell) of the order spread - order stoploss and when n = 1, SL1 = modulo difference (for buy and sell) of the order spread - order stoploss.

ThenFi= Fi-1 + Fi-2 would be SL_actual = SL0 + SL1.

Am I understanding this correctly?

Совершение сделок - Торговые операции - MetaTrader 5
Совершение сделок - Торговые операции - MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
 

How is this panel made? Where can I find a similar example?

ppeek

 
yiduwi:

How is this panel made? Where can I find a similar example?


Most likely the usual graphical rectangle objects OBJ_RECTANGLE_LABEL. Maybe buttons OBJ_BUTTON, or imagesOBJ_BITMAP_LABEL. Or it can be drawn on canvas. But it is too clumsy for canvas.

Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
При создании графического объекта функцией ObjectCreate() необходимо указать тип создаваемого объекта, который может принимать одно из значений перечисления ENUM_OBJECT. Дальнейшие уточнения свойств созданного объекта возможно с помощью функций по работе с графическими объектами.
 
Igor Makanu:

Search KB for "history paging" - there were, but read the description, in MT4 you can't check programmatically that the history is already paged, basically you just have to wait


How do you check in 5 to make sure the data is downloaded?

I have some symbols in a separate profile so they don't get in the way.

   Print(symb," last quotes time = ", iTime(symb,PERIOD_M10,0));
   Print(symb," last quotes bid = ", iClose(symb,PERIOD_M10,0));

For the exotics I haven't opened this week, it's downloaded on the third tick:

2019.07.09 02:16:40.311 t1 (EURUSD,H1) NZDCHF last quotes time = 1970.01.01 00:00:00

2019.07.09 02:16:40.311 t1 (EURUSD,H1) NZDCHF last quotes bid = 0.0

2019.07.09 02:16:40.870 t1 (EURUSD,H1) NZDCHF last quotes time = 1970.01.01 00:00:00

2019.07.09 02:16:40.870 t1 (EURUSD,H1) NZDCHF last quotes bid = 0.0

2019.07.09 02:16:40.970 t1 (EURUSD,H1) NZDCHF last quotes time = 2019.07.08 22:10:00

2019.07.09 02:16:40.970 t1 (EURUSD,H1) NZDCHF last quotes bid = 0.65821


How can I be sure at the moment of signal's check that the data is correct?

I have read "Organizing Data Access", I want to know, if there is an easy way to check whether the data is correct or not.

 
Artyom Trishkin:

Thank you.

Reason: