Отслеживание ордера, после команды OrderSendAsync Михаил | 23 апреля, 2015 В статье рассказывается принцип отслеживания ордера после команды OrderSendAsync, если нет события TradeTransaction
Why? I understand exactly how it works. But I don't want to lose the "straight" mages. Without them it would be difficult for me to quickly find out where and what is in my account at the moment.
Why? I understand exactly how it works. But I don't want to lose the "direct" medgies. Without them it would be difficult for me to quickly figure out where and what is in my account at the moment.
The majik is big, and both the constant part (strategy id, for example) and the "variable" part (request number) can be wrapped in it.
How can you talk about results if the code is badly written?
......
So many "writers" of Expert Advisors, grasp at the work for MICEX, not even knowing many basics of trading on the Stock and Derivatives Market!
You are making too much out of it! The girl was doing fine, especially compared to the characters from the neighboring topics, who are trying to get sellers in the Market without even passing grades in Computer Science with BASIC))
You're making a big deal out of it! The girl was all right, especially compared to the characters in the neighbouring threads, who go to the Market as salesmen without even passing the Basics test.)
what's wrong with her?
she doesn't even know what her output should be or what she needs to do for it.
even the experienced didn't tell me the tricky question because you can't talk about it on every corner
However, I know how to get the right result, because I dedicated about 5 years to studying this topic.
Why? I understand exactly how it works. But I don't want to lose the "direct" medgies. Without them it would be difficult for me to quickly find out where and what is in my account at the moment.
If you write so, you do not understand how it all works!
The high bits of the Majic are formed from the name of the symbol, in addition, you can assign an ID to each EA, and the low bits
create a series of child majicles.
So, you have to claim you understand how it works!
//+------------------------------------------------------------------+//| AutoMagic.mqh |//| Copyright 2017-2018 prostotrader |//| https://www.mql5.com |//+------------------------------------------------------------------+//version "1.02ulong symb_magic;
int exp_id;
//-------------------------------------------------------------------+// Split string function |//+------------------------------------------------------------------+string SplitString(conststring a_str,ulong &a_month,ulong &a_year)
{
int str_size=StringLen(a_str);
int str_tire=StringFind(a_str, "-");
int str_tochka=StringFind(a_str, ".", str_tire);
if((str_tire>0) && (str_tochka>0) &&(str_size > 0))
{
a_month= ulong(StringToInteger(StringSubstr(a_str,str_tire+1,str_tochka-str_tire-1)));
a_year = ulong(StringToInteger(StringSubstr(a_str,str_tochka+1,str_size-str_tochka-1)));
if((a_month > 0) && (a_year > 0)) return(StringSubstr(a_str, 0, str_tire));
}
return("");
}
//-------------------------------------------------------------------+// Get Magic function |//+------------------------------------------------------------------+ulong GetMagic(conststring a_symbol, constint sov_id)
{
exp_id = -1;
symb_magic = 0;
if(SymbolSelect(Symbol(), true) == false)
{
Print(__FUNCTION__, ": Нет такого символа!");
return(0);
}
ulong month = 0;
ulong year = 0;
string new_str = SplitString(a_symbol,month,year);
if(StringLen(new_str)>0)
{
uchar char_array[];
int result=StringToCharArray(new_str, char_array, 0, WHOLE_ARRAY, CP_ACP);
if(result>0)
{
ulong value;
for(int i = 0; i < result - 1; i++)
{
value=ulong(char_array[i]);
value<<=(56 -(i*8));
symb_magic += value;
}
month<<=24;
symb_magic += month;
year<<=16;
symb_magic += year;
exp_id = sov_id; //New!!!int s_id = exp_id;
s_id<<=8; //New !!!
symb_magic += s_id; //New !!!return(symb_magic);
}
}
return(0);
}
//-------------------------------------------------------------------+// Is my magic function |//+------------------------------------------------------------------+bool IsMyMagic(constulong m_magic)
{
if(m_magic > 0)
{
ulong stored_magic = symb_magic;
// stored_magic>>=16;
stored_magic>>=8; //New!!!ulong in_magic = m_magic;
// in_magic>>=16;
in_magic>>=8; //New!!!if(in_magic == stored_magic) return(true);
}
return(false);
}
//-------------------------------------------------------------------+// Get stored magic function |//+------------------------------------------------------------------+ulong GetStoredMagic()
{
if(symb_magic > 0) return(symb_magic);
return(0);
}
//-------------------------------------------------------------------+// Get expert ID function |//+------------------------------------------------------------------+int GetExpertId()
{
return(exp_id); //New!!!
}
//+------------------------------------------------------------------+
2021.01.1910:25:45.855 Test_magic (RTS-3.21,M1) My magic: true2021.01.1910:25:45.855 Test_magic (RTS-3.21,M1) My magic: true2021.01.1910:25:45.855 Test_magic (RTS-3.21,M1) My magic: true2021.01.1910:25:45.855 Test_magic (RTS-3.21,M1) My magic: true2021.01.1910:25:45.855 Test_magic (RTS-3.21,M1) My magic: true2021.01.1910:25:45.855 Test_magic (RTS-3.21,M1) My magic: true2021.01.1910:25:45.855 Test_magic (RTS-3.21,M1) My magic: true
.......................................................................
2021.01.19 10:53:40.451 Test_magic (RTS-3.21,M1) My magic: false
The symbol name + EA id will make sure that the magik is unique,
and in the 0 byte, a series of child majiks (also unique).
The bigge will be automatically created.
Since the FORTS standard login is limited to 30 tr./sec, 256 child magics will be enough for you without 1 byte.
And all this "dancing with knuckles" is needed only in extreme cases, when the connection is lost (MT5 server crashed) and you have not received a ticket order.
He's got a private room for that.
And now you're writing to the media, so we're having a discussion.
I also made it clear to you, use synchronous.
I do use synchronous, what else can I do from a submarine.
....., but I'm not happy with the mechanism that prostotrader uses with crooked mages.
You either don't understand the nature of "crooked" mages at all or don't want to.
https://www.mql5.com/ru/blogs/post/557544
You either don't understand the "crooked" magicians at all or don't want to.
https://www.mql5.com/ru/blogs/post/557544
Why? I understand exactly how it works. But I don't want to lose the "straight" mages. Without them it would be difficult for me to quickly find out where and what is in my account at the moment.
Why? I understand exactly how it works. But I don't want to lose the "direct" medgies. Without them it would be difficult for me to quickly figure out where and what is in my account at the moment.
The majik is big, and both the constant part (strategy id, for example) and the "variable" part (request number) can be wrapped in it.
The majik is big, so you can wrap both the constant part (strategy id, for example) and the "variable" part (query number) into it.
He has an int, not a long
You won't believe it : ) Even with int magic you can trade 1000+ EAs with 1000000+ combinations of strategies in each.
You hear a bell, you don't know where it is.
"Hitting" on the posted code.
......
How can you talk about results if the code is badly written?
......
So many "writers" of Expert Advisors, grasp at the work for MICEX, not even knowing many basics of trading on the Stock and Derivatives Market!
You are making too much out of it! The girl was doing fine, especially compared to the characters from the neighboring topics, who are trying to get sellers in the Market without even passing grades in Computer Science with BASIC))
You won't believe it : ) Even with int magic you can trade 1000+ EAs with 1000000+ combinations of strategies in each.
And if you have logic in your brain, you'll be fine without magicians.
By the way, I was just saying about int to go long if i'm really interested in it.
since the programmer, so to speak...You're making a big deal out of it! The girl was all right, especially compared to the characters in the neighbouring threads, who go to the Market as salesmen without even passing the Basics test.)
what's wrong with her?
she doesn't even know what her output should be or what she needs to do for it.
even the experienced didn't tell me the tricky question because you can't talk about it on every corner
However, I know how to get the right result, because I dedicated about 5 years to studying this topic.
Why? I understand exactly how it works. But I don't want to lose the "direct" medgies. Without them it would be difficult for me to quickly find out where and what is in my account at the moment.
If you write so, you do not understand how it all works!
The high bits of the Majic are formed from the name of the symbol, in addition, you can assign an ID to each EA, and the low bits
create a series of child majicles.
So, you have to claim you understand how it works!
Check out
Result
Change the symbol and id of the EA to 122
Add to code
Result
The symbol name + EA id will make sure that the magik is unique,
and in the 0 byte, a series of child majiks (also unique).
The bigge will be automatically created.
Since the FORTS standard login is limited to 30 tr./sec, 256 child magics will be enough for you without 1 byte.
And all this "dancing with knuckles" is needed only in extreme cases, when the connection is lost (MT5 server crashed) and you have not received a ticket order.