[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 265

 
vasabu2012:

Guys, I don't know Kim, maybe someone knowledgeable could answer in this thread.

I'd really appreciate it!

Here he is Kim Igor V. And here are some useful functions from KimIV
 

Question for Professionals: we need to pull data on the last closed
order, keep count of order numbers is not possible because
If you want to get the data on the last closed order you have to keep count of all the order numbers, it is impossible because several EAs work and everyone puts and closes
Every EA has its own wizard.
The question is about the data from the last closed order in the terminal?

WHO KNOWS THE ANSWER PLEASE!!!

 
vasabu2012:
Question for Professionals: We need to pull data from the last closed
order, to keep count of order numbers is not possible because
I have a few EAs working and all of them put and close
Every EA has its own wizard.
The question is about data from the last closed order in the terminal?

I'm not a scientist, but if you're looking for the last order, find it by time...
 
SPECIFICALLY HOW?
 
How do I make an EA work not only on the demo?
Files:
sovetnik.ex4  31 kb
 
sergio7:
how do i make an EA work not only on demo?
The one you posted here - NOTHING
 
sergio7:
How do I make an EA work not only on the demo?

It is not the source code! It should be mq4, not eh4!
 
paladin80:
The one you have posted here is NOTHING.


The same intruder in another thread:

sergio704.04.2013 21:04
Help make the EA work not only on demo.
Attached files:
tpyokfcx.ex4(30.27 KB)
 

I decided to check out the librariesTarasBy wrote. I started with this onehttps://www.mql5.com/ru/code/10659

There are some questions. I'll be consistent. For example:

//IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII+
//|  Автор : TarasBY, taras_bulba@tut.by                                              |
//+-----------------------------------------------------------------------------------+
//|        Получаем торговую информацию по символу                                    |
//IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII+
void fGet_MarketInfo (string fs_Symbol, int fi_Ticket = 0)
{
//----
         if (fs_Symbol != bs_Symbol || fi_Ticket < 0)
         {
                  if (fi_Ticket > 0)
                  {
                     bs_Symbol = OrderSymbol();
                  }
                  else
                  {
                     bs_Symbol = fs_Symbol;
                  }
                  if (bs_Symbol == Symbol())
                  {
                      bi_SymDigits = Digits;
                      bd_SymPoint = Point;
                  }
                  else
                  {
                      bi_SymDigits = MarketInfo (fs_Symbol, MODE_DIGITS);
                      bd_SymPoint = MarketInfo (fs_Symbol, MODE_POINT);
                  }
        if (bd_SymPoint == 0.0)
        {
           bd_SymPoint = fGet_Point (fs_Symbol);
        }
                  bd_ProfitMIN = NDP (ProfitMIN_Pips);
         }
         if (fi_Ticket > 0)
         {
            fGet_OrderDetails (fi_Ticket);
         }
    //---- Получаем текущие цены по инструменту
    RefreshRates();
    bda_Price[0] = NDD (fGet_TradePrice (0, bb_RealTrade, bs_Symbol));
    bda_Price[1] = NDD (fGet_TradePrice (1, bb_RealTrade, bs_Symbol));
    bd_Spread = NDD (bda_Price[1] - bda_Price[0]);
//----
}

We can see in the function parameter itself:

fi_Ticket = 0

Usually such functions are called already after order selection, which means they will have a ticket. Why should we assign a default value of zero then?

The next step is even more interesting:

if (fs_Symbol != bs_Symbol || fi_Ticket < 0)
{
   if (fi_Ticket > 0)
   {
      bs_Symbol = OrderSymbol();
   }
   else
   {
     bs_Symbol = fs_Symbol;
                  }
                  if (bs_Symbol == Symbol())
                  {
                      bi_SymDigits = Digits;
                      bd_SymPoint = Point;
                  }

The variable fs_Symbol is immediately compared to bs_Symbol.

Thebs_Symbol above was not initialized, where thefGet_MarketInfo()function itself is called. And what is this bs_Symbol for anyway ?

also in the condition:

if (fs_Symbol != bs_Symbol || fi_Ticket < 0)

condition, iffi_Ticket < 0, then next...

if (fi_Ticket > 0)
{
   bs_Symbol = OrderSymbol();
}

and this already contradicts the condition. At the beginning of the code the conditionfi_Ticket < 0 must hold, and then inside this condition the ticket > 0. Where is the logic?