Maximum length of a symbol name on FOREX - page 12

 
prostotrader:

You're right, the ChartID will change on restart, hence nothing needs to be saved in the Global Variables of the terminal.

er... so the EA will lose all its orders-positions opened before, and that's OK?

 
Taras Slobodyanik:

er... so the EA will lose all its orders-positions opened before, and that's OK?

When searching for an order by magik, you will know the current magik, hence all other magiks from the previous one(s).

There is an IsMyMagic() function

 
Fast528:

Each currency has a three-digit code, where the first two letters stand for the country and the last third letter for the currency itself (dollar - D, franc - F, pound - P).

This three-digit allocation of currencies is regulated by a special standard, ISO 4217. In 1978 the International Organization for Standardization recommended that all countries use three-letter and three-digit currency codes.

Seriously?

where the first two letters stand for the country and the last third letter for the currency itself

And what do you think the currency of the eurozone is called? EUR - EU R
 
prostotrader:

When searching for an order by magician, you will know the current magician, hence all other magicians from the previous magician(s).

Consequently, anything that is open before the restart is irrelevant...

Yes, then the chart id will do.
You can just add the current order counter to this number and not bother with checksums and bit shifts.

 
Taras Slobodyanik:

hence whatever is open before the restart is irrelevant...

Yes, then the chart id will do.
We can just add the counter of current orders to this number and not bother with checksums and bit shifts.

You can avoid the hassle at all, as already suggested

Input ulong = NUMBER;

We just need to keep record of this NUMBER for each EA - different, leaving the two low-order bytes zero,

then we will be able to use 65535 magic numbers for EVERY EA

input ulong StMagic = 1; //Установка магика
ulong master_magic;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   master_magic = StMagic<<16;   
   
//---
   return(INIT_SUCCEEDED);
  }

Correspondingly for the next EA

input ulong StMagic = 2; //Установка магика
Remembering to save the settings
 
Nikolay Demko:

Seriously?

And what do you call the eurozone currency? EUR - EU R

I also wonder what the letter B stands for? )
EURRUB - RU B

 
Taras Slobodyanik:

I also wonder what the letter B stands for? )
EURRUB - RU B

It's scary to think about ))

 
prostotrader:

You could do without the hassle, as suggested before

Input ulong = NUMBER;

We just need to keep track of that NUMBER for each Expert Advisor - different, leaving the two low-order bytes zero

Accordingly, for the following Expert Advisor

Don't forget to save the settings

You reload the terminal, or just close the chart, open it again.

You have the trade history and the Expert Advisor (should) recognize its trades. Well, this is normal if he understands that he was the one who opened it.

The ID of the chart has changed: how the EA running on the current chart should understand that these are his past trades?

 
Nikolay Demko:

You reload the terminal, or simply close the chart, open it again.

You have a trading history and the EA (should) recognise your trades. Well this is normal if it understands that it was the one who opened it.

So, the chart ID has changed: how the EA that was launched on this chart knows that these are its previous deals?

Please read carefully!

Reason: