Errors, bugs, questions - page 72

 
k47:

Yes, there is indeed a bug here,DoubleToString was set by mistake. So the problem remains only in the documentation.

By the way, the documentation does not correspond to reality in the CAccountInfo class too concerning methods of access to properties by identifier.

The InfoString() is defined asdoubleInfoString(...) and at the same time

The return value is

true - if successful, false - if failed to retrieve property value.

This is hardly the way the type is specified. Most likely, the value is returned in two ways - via return and via parameter by reference. This is also confirmed by the fact that the method returns string when used:

The same is true fordoubleInfoInteger() which actually returns long instead of bool, and doubleInfoDouble() which is also written
true - if successful, false - if unsuccessful in retrieving value of the property.

Although again, as you can see in the picture, only one parameter is defined, so reference is out of the question....

Thank you for the message. The library is still changing, and apparently we don't always have time to make changes to the language documentation. We'll figure it out and bring it up to date.
 
Interesting:

Strange behaviour of the strategy tester...


In the build 298, we detected a strange behavior of the strategy tester after cancelling the testing process (I had not noticed it before).

Result

The "Cancel" button becomes a "Start" button, testing is stopped. Everything seemed to be fine, but no - the parameters remain grayed out and it is impossible to edit them.


Thank you. Reproduced and corrected
 

Good afternoon! can you tell me why the handicapped stop is rash?

Basically it's a lossless transfer code... I think many will find it useful...

{ int  LevelWLoss  = 10;
  int PosTotal=PositionsTotal();
   for(int i=PosTotal-1; i>=0; i--)
     {
                 MqlTick lasttick;
            SymbolInfoTick(Symbol(),lasttick);
      if (PositionGetInteger(POSITION_TYPE)==0) {
        if (PositionGetDouble(POSITION_SL)-PositionGetDouble(POSITION_PRICE_OPEN)<LevelWLoss*Point()) {
          if (lasttick.bid-PositionGetDouble(POSITION_PRICE_OPEN)>LevelProfit*Point()) {
         
          MqlTradeRequest BezubModif;
                  BezubModif.action= TRADE_ACTION_SLTP;
                  BezubModif.symbol= Symbol();
                  BezubModif.sl = NormalizeDouble(PositionGetDouble(POSITION_PRICE_OPEN)+LevelWLoss*Point(),_Digits);
                  BezubModif.tp = PositionGetDouble(POSITION_TP);
                  BezubModif.deviation=3;
          MqlTradeResult BezubModifResult;
                  OrderSend(BezubModif,BezubModifResult);                                                                                       
          }
        }
      }
      if (PositionGetInteger(POSITION_TYPE)==1) {
        if (PositionGetDouble(POSITION_SL)==0 || PositionGetDouble(POSITION_PRICE_OPEN)-PositionGetDouble(POSITION_SL)<LevelWLoss*Point()) {
          if (PositionGetDouble(POSITION_PRICE_OPEN)-lasttick.ask>LevelProfit*Point()) {

            MqlTradeRequest BezubModif;
                  BezubModif.action= TRADE_ACTION_SLTP;
                  BezubModif.symbol= Symbol();
                  BezubModif.sl = NormalizeDouble(PositionGetDouble(POSITION_PRICE_OPEN)-LevelWLoss*Point(),_Digits);
                  BezubModif.tp = PositionGetDouble(POSITION_TP);
                  BezubModif.deviation=3;
            MqlTradeResult BezubModifResult;
                  OrderSend(BezubModif,BezubModifResult);                     
          }
        }
      }
    }
  }
 
DEDMOROZ:

Good afternoon! Can you tell me why the disabled foot is rash?


Can't you edit your post properly? There's a special function for inserting code, like...
MQL5.community - Памятка пользователя
MQL5.community - Памятка пользователя
  • 2010.02.23
  • MetaQuotes Software Corp.
  • www.mql5.com
Вы недавно зарегистрировались и у вас возникли вопросы: Как вставить картинку в сообщение на форуме, как красиво оформить исходный код MQL5, где находятся ваши Личные сообщения? В этой статье мы подготовили для вас несколько практических советов, которые помогут быстрее освоиться на сайте MQL5.community и позволят в полной мере воспользоваться доступными функциональными возможностями.
 

Developers - Where do you get such weed?

The server must be so "stoned" to declare SELL positions as POSITION_TYPE_BUY (0), Buy mustbe POSITION_TYPE_SELL (1)...


I mean the question above and how this code works:

if (PositionGetInteger(POSITION_TYPE)==0)

PS

DEDMOROZ, have you tried using identifiers?

Besides it's useful to divide code of large blocks into parts (OOP is coming)...

 
Interesting:

Developers - Where do you get such weed?

The server must be so "stoned" to declare SELL positions as POSITION_TYPE_BUY (0), Buy mustbe POSITION_TYPE_SELL (1)...


Because there are other enumerations with ORDER_TYPE_BUY, DEAL_TYPE_SELL, BOOK_TYPE_BUY

 
stringo:

Because there are other enumerations with ORDER_TYPE_BUY, DEAL_TYPE_SELL, BOOK_TYPE_BUY

And what does PositionGetInteger(POSITION_TYPE) have to do with it? And what do POSITION_TYPE_BUY and POSITION_TYPE_SELL have to do with it ?


A simple example:

I now have an open Sell position in EUR (opened from the market). I see it as Sell, but my Expert Advisor sees it as Buy (0).

I open the help for PositionGetInteger(POSITION_TYPE) and see that the server obviously confuses something...


PS

The man sees an open position, the man sees the help and does everything correctly (in his opinion), but the server has as always a "special" opinion...

 
Interesting:

A simple example:

I now have an open Sell position in EUR (opened from the market). I see it as Sell, but EA sees it as Buy (0).

I open the help for PositionGetInteger(POSITION_TYPE) and I see that the server is obviously confused about something...


PS

Man sees the open position, man sees the help and does everything correctly (in his opinion), but the server has as always a "special" opinion...

Before seeing an open pose, you should first call the PositionSelect function
 
stringo:
Before seeing an open pose, you should first call the PositionSelect function

Then I apologize, I've had time to smoke today...

 
DEDMOROZ:

Good afternoon! can you tell me why the handicapped stop is rash?

Basically it's a lossless transfer code... I think many will find it useful...


   for(int i=PosTotal-1; i>=0; i--)//перебор позиций имеет смысл, если перенос в безубыток мультивалютный
     {//где-то тут должен быть выбор позиции, которую будем допрашивать :)
                 MqlTick lasttick;
            SymbolInfoTick(Symbol(),lasttick);//ask,bid всегда берутся с текущего символа.
either you don't need an overshoot, or you need to ask,bid on the symbol of the pose
Reason: