Useful features from KimIV - page 77

 
granit77 писал(а) >>

A simple formula for automatic magician generation for EAs working simultaneously on different instruments in the same account came to mind.

Interesting. Why do you need it for instruments? It is clear from timeframes.

We usually check the magin and the symbol. You cannot confuse them.

 
My thought process is as follows: you run a bunch of EAs on one account for different instruments and TFs. To ensure that they do not try to manage other people's orders, we generate a unique wizard for each one and we do not need to check anything else (in case the EA is multi-currency).
 

Hm... strange situation...

Seems to be a simple function to calculate the time difference between the server and the locale in hours.

However, it stubbornly shows 2 even though it's actually 3 hours different...:

d=((TimeLocal()-TimeCurrent())/3600);
 
I've got it right, 4 o'clock, you know where. Have you switched to summer?
 
granit77 писал(а) >>

I came up with a simple formula for automatic generation of magik for EAs working simultaneously on different instruments in the same account.

For example, such a variant... Both pair and TF match... the difference is in trading direction... your function will give you one Magik number... but you need different ones...

I think the best way to set a magik is to link it to a window handle during Expert Advisor launching...

 
kharko >> :

For example, this option... Both the pair and the TF match... the difference is the direction of trade... your function will give you one magician number... You need different ones...

I think the best way to set a magik is to link it to a window descriptor when your Expert Advisor runs...

I don't really understand about the trading direction, this simple generator assumes that not more than one EA will work on one pair and one TF.

Your variant gives a unique magik, but what if we have to remove and put the EA again when there are open positions? A new unique magician will be generated and the Expert Advisor will "not know its own". A simple variant will easily swallow this.

Besides, it's just right for me, words like descriptor scare me. :))

 
granit77 писал(а) >>

I don't really understand about the direction of trade, this simple generator assumes that no more than one EA will work on one pair and one TF.

Your option gives a unique magik, but what if I have to remove and put the EA back on again when there are open positions? A new unique magician will be generated and the Expert Advisor will "know none of its own". The simple variant will easily swallow it.

Besides, it's just the way I like it, words like "descriptor" scare me. :))

Here is another variant of 'MagicNumber - "magic" order identifier that I use

 
granit77 >> :
I got it right, 4:00, you know where. Did you switch to daylight saving time?

Yes, I did...

The problem seems to be a trivial server time lag,

>> which is why the rounding down of the intake is having that effect...

 
granit77 писал(а) >>

I don't really understand about the direction of trade, this simple generator assumes that no more than one EA will work on one pair and one TF.

Your option gives a unique magik, but what if I have to remove and put the EA back on again when there are open positions? A new unique magician will be generated and the Expert Advisor will "not know its own". The simple variant will easily swallow it.

Besides, it's just the way I like it, words like "descriptor" scare me. :))

I trade in both directions with one EA, but the parameters for each EA are different: the signal to open a deal and the signal to close it... And the signal to close the deal does not coincide with the signal to open the opposite position.... I see now...

As for withdrawing an EA with open positions, I think this is unlikely to happen... Would you leave an infant alone without supervision?

Perhaps you should use global variables and take the value of Magician from there... In case of need a global variable can always be edited....

 
kharko >> :

I trade in both directions with one EA, but the EA parameters are different for each: a signal to open a trade and a signal to close a trade... The signal to close a trade does not coincide with a signal to open the opposite position.... I see now...

As for withdrawing an EA with open positions, I think this is unlikely to happen... Would you leave an infant alone without supervision?

Perhaps you should use global variables and take the value of Magician from there... In case of need a global variable can always be edited....

So many people, so many opinions. It's a good thing, that mine is the same as komposter's on Prival's link.

As a suggestion: in your case, if you have two magicians in your EA, you can use the magician generated for the pair and the TF and its negative value.