Questions from Beginners MQL5 MT5 MetaTrader 5 - page 31 1...242526272829303132333435363738...1605 New comment Dimka-novitsek 2012.09.01 16:42 #301 Yes, of course I encoded it correctly in theory, but on a five the print function doesn't work quite right, it's messy, and often doesn't write. Yes!! Yedelkin 2012.09.01 16:43 #302 Dimka-novitsek:Yeah, that's actually the script I was offered to write, apparently, which I inserted into the he tick function of my expert! No, it's not a script. These are your lines. The script must output lines like Print(EnumToString((ENUM_TIMEFRAMES)i)+"="+IntegerToString(i)); Yedelkin 2012.09.01 16:46 #303 Dimka-novitsek:...on the five the print function works somehow not quite right, with a twist, and often doesn't write. Yes!! The Expert tab may not show all the messages of a running programme. To see all messages, you have to look at the logs (right mouse button, "Open"). WiND 2012.09.01 17:34 #304 It turns out that CSymbolInfo.Refresh() function doesn't refresh ticks, but CSymbolInfo.RefreshRates() should be used instead;)CSymbolInfo.Refresh() - updates symbol dataCSymbolInfo.RefreshRates() - updates quotes=)If everything is clear with the second method, but what is the purpose of the first method? How to use the Questions how to ensure MetaEditor build 1463 Yedelkin 2012.09.01 17:57 #305 WiND: It turns out that CSymbolInfo.Refresh() function doesn't refresh ticks, but CSymbolInfo.RefreshRates() should be used instead;)CSymbolInfo.Refresh() - updates symbol dataCSymbolInfo.RefreshRates() - updates quotes=)If everything is clear with the second method, but what is the purpose of the first method? Well, you never know. Maybe, someone needs to update data on swaps, check funds when entering the market, etc. See the code for more details:bool CSymbolInfo::Refresh(void) { long tmp=0; //--- if(!SymbolInfoDouble(m_name,SYMBOL_POINT,m_point)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_TRADE_TICK_VALUE,m_tick_value)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_TRADE_TICK_VALUE_PROFIT,m_tick_value_profit)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_TRADE_TICK_VALUE_LOSS,m_tick_value_loss)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_TRADE_TICK_SIZE,m_tick_size)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_TRADE_CONTRACT_SIZE,m_contract_size)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_VOLUME_MIN,m_lots_min)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_VOLUME_MAX,m_lots_max)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_VOLUME_STEP,m_lots_step)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_VOLUME_LIMIT,m_lots_limit)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_SWAP_LONG,m_swap_long)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_SWAP_SHORT,m_swap_short)) return(false); if(!SymbolInfoInteger(m_name,SYMBOL_DIGITS,tmp)) return(false); m_digits=(int)tmp; if(!SymbolInfoInteger(m_name,SYMBOL_TRADE_EXEMODE,tmp)) return(false); m_trade_execution=(ENUM_SYMBOL_TRADE_EXECUTION)tmp; if(!SymbolInfoInteger(m_name,SYMBOL_TRADE_CALC_MODE,tmp)) return(false); m_trade_calcmode=(ENUM_SYMBOL_CALC_MODE)tmp; if(!SymbolInfoInteger(m_name,SYMBOL_TRADE_MODE,tmp)) return(false); m_trade_mode=(ENUM_SYMBOL_TRADE_MODE)tmp; if(!SymbolInfoInteger(m_name,SYMBOL_SWAP_MODE,tmp)) return(false); m_swap_mode=(ENUM_SYMBOL_SWAP_MODE)tmp; if(!SymbolInfoInteger(m_name,SYMBOL_SWAP_ROLLOVER3DAYS,tmp)) return(false); m_swap3=(ENUM_DAY_OF_WEEK)tmp; if(!SymbolInfoDouble(m_name,SYMBOL_MARGIN_INITIAL,m_margin_initial)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_MARGIN_MAINTENANCE,m_margin_maintenance)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_MARGIN_LONG,m_margin_long)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_MARGIN_SHORT,m_margin_short)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_MARGIN_LIMIT,m_margin_limit)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_MARGIN_STOP,m_margin_stop)) return(false); if(!SymbolInfoDouble(m_name,SYMBOL_MARGIN_STOPLIMIT,m_margin_stoplimit)) return(false); if(!SymbolInfoInteger(m_name,SYMBOL_EXPIRATION_MODE,tmp)) return(false); m_trade_time_flags=(int)tmp; if(!SymbolInfoInteger(m_name,SYMBOL_FILLING_MODE,tmp)) return(false); m_trade_fill_flags=(int)tmp; //--- ok return(true); } Документация по MQL5: Торговые функции / OrderCheck www.mql5.com Торговые функции / OrderCheck - Документация по MQL5 Dimka-novitsek 2012.09.01 18:36 #306 THANK YOU!!!Of course, my lines. Wanted to write that I'm a sucker, they're my lines, and saw your comment. You have to look at the logs (right mouse button, "Open") to see all the posts. THANK YOU!!! MT 5 Keeps Crashing Discussion of article "General [WARNING CLOSED!] Any newbie WiND 2012.09.02 15:38 #307 There is a character code in utf8 encoding as a string ( example: "041e" )How to get the equivalent of this code in the 10-th system, and then convert it to a character (code 041e = Russian letter O)What a mess, but I can't figure it out:) What's new in MetaTrader Any questions from newcomers Extracting Double Value from Dimka-novitsek 2012.09.03 08:29 #308 Good morning! I don't quite know what I'm doing this morning. Please tell me, these first two variables, what's wrong with them? Olegs Kucerenko 2012.09.03 08:37 #309 Dimka-novitsek: Good morning, I do not quite know what I'm doing. Please tell me these first two variables, what's wrong with them?The first string variable you define as a function, make it empty (=NULL or ="").Then in OnInit you can make =_Symbol .The second one.Either put ; after 5 or remove the second int. Dimka-novitsek 2012.09.03 08:40 #310 THANK YOU!!! 1...242526272829303132333435363738...1605 New comment
Yeah, that's actually the script I was offered to write, apparently, which I inserted into the he tick function of my expert!
...on the five the print function works somehow not quite right, with a twist, and often doesn't write. Yes!!
It turns out that CSymbolInfo.Refresh() function doesn't refresh ticks, but CSymbolInfo.RefreshRates() should be used instead;)
CSymbolInfo.Refresh() - updates symbol data
CSymbolInfo.RefreshRates() - updates quotes=)
If everything is clear with the second method, but what is the purpose of the first method?
It turns out that CSymbolInfo.Refresh() function doesn't refresh ticks, but CSymbolInfo.RefreshRates() should be used instead;)
CSymbolInfo.Refresh() - updates symbol data
CSymbolInfo.RefreshRates() - updates quotes=)
If everything is clear with the second method, but what is the purpose of the first method?
THANK YOU!!!
Of course, my lines. Wanted to write that I'm a sucker, they're my lines, and saw your comment.
You have to look at the logs (right mouse button, "Open") to see all the posts. THANK YOU!!!
There is a character code in utf8 encoding as a string ( example: "041e" )
How to get the equivalent of this code in the 10-th system, and then convert it to a character (code 041e = Russian letter O)
What a mess, but I can't figure it out:)
Good morning, I do not quite know what I'm doing. Please tell me these first two variables, what's wrong with them?
The first string variable you define as a function, make it empty (=NULL or ="").Then in OnInit you can make =_Symbol .
The second one.Either put ; after 5 or remove the second int.