Errors, bugs, questions - page 970

 
Lizar:

IsStopped() used to help combat looping - that's for sure. Since some time the "perpetual loop" is not cured byIsStopped() and, in fact, we have to delete the terminal process in order to restore operation. Although the type indicator is deleted from the chart with no problem, but the chart hangs.

For fun, you can try a specially looped indicator. By the way, as it is supposed in such a case, OnDeinit() does not work.

It's scary even to run it)
 
zfs:
It's scary to even run it.)
And there's no need to run what's in the attachment. This is for those who want to test it. But, if indicators with heavy calculations are used, this moment may affect. It is necessary to check.
 

How to send a request (message) from Android Client to MetaTrader Client, for example, to send a Notification

The only way to do this is to place a pending order on an unused symbol, and then the EA will find it, send a message with the required information and delete the pending order.

 

Good afternoon!

In the build of 19.04.13 the debugger is now displaying the contents of MqlRate in curly brackets. Thank you MQ for that! Are there any plans to make the display of such data expandable? In the sense of looking like a tree. This could be extended to classes as well.

Thank you!

For example:

CAbstractFilter{ meSS:CStrategySettings{ meEntrancePeriod:PERIOD_M15 meHistoryDepth:100 meSymbol: "EURUSD" meHistoryRates:[100] meRangeLimit:0.2 meHiLo:0.006 meHiLoMax:0.02 meTimeStart:" 06:00" meTimeEnd:" 20:00" meAsianStart:" 00:00" meAsianEnd:" 07:... }

Better:

CAbstractFilter:

+ { meSS:CStrategySettings

+ { { meEntrancePeriod:PERIOD_M15

meHistoryDepth:100

meSymbol: "EURUSD"

meHistoryRates:[100]

meRangeLimit:0.2}

and so on, similar to the tree structure of directories in Windows Explorer.

Thank you!

 

Hello again!

Step to cursor would be very useful in the debugger. Hopefully it will appear someday. Appreciate your comments in advance on possible timelines.

Thank you!

 

Has anyone had such a problem when using the standard library?

RF      0       19:42:38        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
RJ      0       19:42:38        Trades  '1001326': deal #204868 sell 1.00 ED-6.13 at 1.3058 done (based on order #2946444)
OQ      0       20:30:54        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
DJ      0       20:30:55        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
FF      0       20:30:55        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
DO      0       20:30:55        Trades  '1001326': deal #204952 buy 1.00 ED-6.13 at 1.3054 done (based on order #2946510)
FK      0       20:30:55        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
HG      0       20:30:55        Trades  '1001326': deal #204953 buy 1.00 ED-6.13 at 1.3054 done (based on order #2946511)
LO      0       20:30:55        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
NS      0       20:30:55        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
NK      0       20:30:55        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
LN      0       20:30:55        Trades  '1001326': deal #204954 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946512)
OR      0       20:30:56        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
EG      0       20:30:56        Trades  '1001326': deal #204955 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946513)
ME      0       20:30:56        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
IN      0       20:30:56        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
OI      0       20:30:56        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
JS      0       20:30:56        Trades  '1001326': deal #204956 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946514)
GO      0       20:30:56        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
NJ      0       20:30:56        Trades  '1001326': deal #204957 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946515)
JD      0       20:30:57        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
PO      0       20:30:57        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
HP      0       20:30:57        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
JJ      0       20:30:57        Trades  '1001326': deal #204958 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946516)
DM      0       20:30:57        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
RS      0       20:30:57        Trades  '1001326': deal #204959 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946517)
JI      0       20:30:57        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
GS      0       20:30:58        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
IM      0       20:30:58        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
OF      0       20:30:58        Trades  '1001326': deal #204960 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946518)
ID      0       20:30:58        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
KN      0       20:30:58        Trades  '1001326': deal #204961 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946519)
OP      0       20:30:58        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
QJ      0       20:30:58        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
QL      0       20:30:58        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
KG      0       20:30:58        Trades  '1001326': deal #204962 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946520)
NI      0       20:30:59        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
DO      0       20:30:59        Trades  '1001326': deal #204963 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946521)
PM      0       20:30:59        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
DG      0       20:30:59        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
NQ      0       20:30:59        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
GJ      0       20:30:59        Trades  '1001326': deal #204964 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946522)
FH      0       20:30:59        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
KR      0       20:30:59        Trades  '1001326': deal #204965 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946523)
OL      0       20:31:00        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
IF      0       20:31:00        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
QH      0       20:31:00        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
CS      0       20:31:00        Trades  '1001326': deal #204966 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946524)
ME      0       20:31:00        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
KK      0       20:31:00        Trades  '1001326': deal #204967 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946525)
PP      0       20:31:01        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
DK      0       20:31:01        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
FE      0       20:31:01        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
ON      0       20:31:01        Trades  '1001326': deal #204968 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946526)
FL      0       20:31:01        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
KF      0       20:31:01        Trades  '1001326': deal #204969 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946527)
LH      0       20:31:01        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
KR      0       20:31:02        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
KD      0       20:31:02        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
HO      0       20:31:02        Trades  '1001326': deal #204970 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946528)
OQ      0       20:31:02        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
PD      0       20:31:02        Trades  '1001326': deal #204971 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946529)
MD      0       20:31:02        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
IO      0       20:31:02        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
OH      0       20:31:02        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
JR      0       20:31:02        Trades  '1001326': deal #204972 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946530)
GP      0       20:31:02        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
MM      0       20:31:03        Trades  '1001326': deal #204973 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946531)
JE      0       20:31:03        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
PN      0       20:31:03        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
HQ      0       20:31:03        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
RK      0       20:31:03        Trades  '1001326': deal #204974 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946532)
DL      0       20:31:03        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
GP      0       20:31:03        Trades  '1001326': deal #204975 sell 1.00 ED-6.13 at 1.3051 done (based on order #2946533)
CH      0       20:31:04        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
OD      0       20:31:04        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
NN      0       20:31:04        Trades  '1001326': deal #204976 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946534)

I tried to close one position SELL, although the check of Expert Advisor is that first we check for position type.

if(PositionSelect(_Symbol) && PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL)
        {
         trade.PositionClose(_Symbol);

        }

I got a lot of position reversals as a result, until my request was quickly executed

the Expert Advisor code is looped with 300 ms slip

The result -100 roubles.

Как использовать торговые классы Стандартной библиотеки при написании советника
Как использовать торговые классы Стандартной библиотеки при написании советника
  • 2010.11.10
  • Samuel
  • www.mql5.com
В статье рассказывается о том, как использовать основной функционал торговых классов Стандартной библиотеки при написании советников, в которых применяется открытие, закрытие и модификация позиции, проверка свободной маржи перед размещением торговых ордеров, размещение и удаление отложенных ордеров. Показано, как использовать торговые классы для получения свойств ордеров и сделок.
 
olyakish:

Has anyone had any trouble with this?

the rake is not in the lib, because it reflects the essence of asynchrony of MT5

You have a rake in your code because you haven't made the blocking of new orders until you get the answer about the previous order's execution.

In MT5 you should independently arrange something similar to Trade Context Busy for the sent order, as it was in MT4.

You should not make new attempts to send a similar order until you see the report of the previous order execution.

You should catch the execution either in OnTrade or OnTradeTransaction.

Good luck. ;)

 

I feel full.

In the indicator I assign a value to a variable.

#property indicator_separate_window

...

int x;//

int OnInit()

{

}

int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[],const double &open[],
                const double &high[],const double &low[],const double &close[],const long &tick_volume[],
                const long &volume[],const int &spread[])
  {

 if(prev_calculated==0){

//при 1-м запуске присваиваю значение

x=у;//у!=7558445

}

else

{

Print(x);//здесь x уже =7558445.

}

}

What am I doing wrong?

 
But now it's fine, although the code hasn't been changed. Just restarted the terminal. And this bug is related to the histogram disappearing, which was mentioned earlier, and it appears and disappears. What can this be caused by?
 
sergeev:

the rake is not in the lib, because it reflects the essence of asynchrony of MT5

You have a rake in your code because you haven't made the blocking of new orders until you get the answer about the previous order's execution.

In MT5 you should independently arrange something similar to Trade Context Busy for the sent order, as it was in MT4.

In other words, you should not make new attempts to send a similar order until you see the report of the previous order execution.

You should catch the execution either in OnTrade or OnTradeTransaction.

Good luck. ;)

Yeah, that's what I thought already, I'll have to do some additional analysis. Thanks for confirming my guess
Reason: