初学者的问题 MQL5 MT5 MetaTrader 5 - 页 1192 1...118511861187118811891190119111921193119411951196119711981199...1503 新评论 Artyom Trishkin 2020.03.09 16:36 #11911 Artem Mordvinkin: 它以通俗的英语写道,符号自动连接到测试中 当你访问它们时。 Vladimir Karputov 2020.03.09 16:38 #11912 Artem Mordvinkin: 是的,俄语中写道,在测试过程中,符号会自动连接。 要创建一个指标,你必须首先在Market Watch中连接一个符号(在你的例子中是在测试器的Market Watch中)。 Artem Mordvinkin 2020.03.09 16:38 #11913 Artyom Trishkin: 要求从每个所需的符号中获取任何数据。 他们由SymbolSelect()丢失 - 未被选中 亲爱的先生们 在向我推荐出版物之前(为此我感谢你们),请检查--你们的多币种是否在测试器中工作。 Artyom Trishkin 2020.03.09 16:40 #11914 Artem Mordvinkin: 他们由SymbolSelect()丢失 - 未被选中 亲爱的先生们 在向我推荐出版物之前(为此我感谢你们),请检查--你们的多币种是否在测试器中工作。 他们的工作。在最新的构建中。一点问题都没有。 Artem Mordvinkin 2020.03.09 16:45 #11915 Artyom Trishkin: 它是有效的。在最新的构建中。一点问题都没有。 你是如何连接它们的(符号)--你能告诉我哪个功能吗? Vladimir Karputov 2020.03.09 16:47 #11916 Artem Mordvinkin: 你是如何连接它们的(符号)--你能告诉我哪个功能吗? SymbolSelect(character name,true)。 Artem Mordvinkin 2020.03.09 16:50 #11917 Vladimir Karputov: SymbolSelect(character name,true)。 我也是这样做的。 SymbolSelect(EURUSD_inst, true); SymbolSelect(GBPUSD_inst, true); SymbolSelect(USDJPY_inst, true); SymbolSelect(AUDUSD_inst, true); 我是这样理解的 2020.03.09 19:19:45.766 符号EURUSDrfd不存在。 2020.03.09 19:19:45.766 符号USDJPYrfd不存在 2020.03.09 19:19:45.766 符号AUDUSDrfd不存在 该电缆没有出现错误,因为它在测试器中被选中。 符号名称是正确的。 在我看来,它需要在终端设置本身做一些事情。如果在上次构建之前一切都在工作,那就与代码无关。测试员看不到这些符号。 Vladimir Karputov 2020.03.09 16:56 #11918 Artem Mordvinkin: 2020.03.09 19:19:45.766 符号EURUSDrfd不存在。 2020.03.09 19:19:45.766 符号USDJPYrfd不存在 2020.03.09 19:19:45.766 符号AUDUSDrfd不存在 电缆没有出现错误,因为它在测试器中被选中。 它是什么?代码在哪里?你如何得到它?特别是你在选择完全不同的人物。 Artem Mordvinkin 2020.03.09 17:01 #11919 Vladimir Karputov: 它是什么?代码在哪里?你如何得到它?特别是你选择了完全不同的角色。 明白了,我们这样走吧。 给定(人物名称) 代码(片段) //----------------------------название инструмента string EURUSD_inst = "EURUSDrfd"; string GBPUSD_inst = "GBPUSDrfd"; string AUDUSD_inst = "AUDUSDrfd"; string USDJPY_inst = "USDJPYrfd"; void OnTick() { SymbolSelect(EURUSD_inst, true); SymbolSelect(GBPUSD_inst, true); SymbolSelect(USDJPY_inst, true); SymbolSelect(AUDUSD_inst, true); } 让我们选择测试器中的电缆作为例子。 运行它并 2020.03.09 19:19:45.766 符号EURUSDrfd不存在。 2020.03.09 19:19:45.766 符号USDJPYrfd不存在 2020.03.09 19:19:45.766 符号AUDUSDrfd不存在 电缆没有错误 - 它在测试仪中被默认选择。 为了以防万一,我要说的是,这个问题只存在于测试器中。而且,这个猫头鹰是几年前的,错误是2天前的,我所有的多币种猫头鹰都是这种情况。 Vladimir Karputov 2020.03.09 17:05 #11920 在 "USDJPY "符号上创建iMA指标的例子,测试者在 "EURUSD "上运行。 //+------------------------------------------------------------------+ //| iMA Values on a Chart.mq5 | //| Copyright © 2019, Vladimir Karputov | //+------------------------------------------------------------------+ #property copyright "Copyright © 2019, Vladimir Karputov" #property version "1.001" //--- input parameters input string Inp_MA_symbol = "USDJPY"; // MA: symbol name input ENUM_TIMEFRAMES Inp_MA_period = PERIOD_D1; // MA: timeframe input int Inp_MA_ma_period = 12; // MA: averaging period input int Inp_MA_ma_shift = 5; // MA: horizontal shift input ENUM_MA_METHOD Inp_MA_ma_method = MODE_SMA; // MA: smoothing type input ENUM_APPLIED_PRICE Inp_MA_applied_price = PRICE_CLOSE; // MA: type of price //--- int handle_iMA; // variable for storing the handle of the iMA indicator //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { if(!SymbolSelect(Inp_MA_symbol,true)) { PrintFormat("Failed select symbol %s", Inp_MA_symbol); return(INIT_FAILED); } //--- create handle of the indicator iMA handle_iMA=iMA(Inp_MA_symbol,Inp_MA_period,Inp_MA_ma_period,Inp_MA_ma_shift, Inp_MA_ma_method,Inp_MA_applied_price); //--- if the handle is not created if(handle_iMA==INVALID_HANDLE) { //--- tell about the failure and output the error code PrintFormat("Failed to create handle of the iMA indicator for the symbol %s/%s, error code %d", Inp_MA_symbol, EnumToString(Inp_MA_period), GetLastError()); //--- the indicator is stopped early return(INIT_FAILED); } //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- double array_ma[]; ArraySetAsSeries(array_ma,true); int start_pos=0,count=3; if(!iGetArray(handle_iMA,0,start_pos,count,array_ma)) return; string text=""; for(int i=0; i<count; i++) text=text+IntegerToString(i)+": "+DoubleToString(array_ma[i],Digits()+1)+"\n"; //--- Comment(text); } //+------------------------------------------------------------------+ //| Get value of buffers | //+------------------------------------------------------------------+ bool iGetArray(const int handle,const int buffer,const int start_pos, const int count,double &arr_buffer[]) { bool result=true; if(!ArrayIsDynamic(arr_buffer)) { //if(InpPrintLog) PrintFormat("ERROR! EA: %s, FUNCTION: %s, this a no dynamic array!",__FILE__,__FUNCTION__); return(false); } ArrayFree(arr_buffer); //--- reset error code ResetLastError(); //--- fill a part of the iBands array with values from the indicator buffer int copied=CopyBuffer(handle,buffer,start_pos,count,arr_buffer); if(copied!=count) { //--- if the copying fails, tell the error code //if(InpPrintLog) PrintFormat("ERROR! EA: %s, FUNCTION: %s, amount to copy: %d, copied: %d, error code %d", __FILE__,__FUNCTION__,count,copied,GetLastError()); //--- quit with zero result - it means that the indicator is considered as not calculated return(false); } return(result); } //+------------------------------------------------------------------+ 结果是正确的。首先选择符号,然后用它创建指标。 附加的文件: iMA_Values_on_a_Chart.mq5 8 kb 1...118511861187118811891190119111921193119411951196119711981199...1503 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
它以通俗的英语写道,符号自动连接到测试中
是的,俄语中写道,在测试过程中,符号会自动连接。
要创建一个指标,你必须首先在Market Watch中连接一个符号(在你的例子中是在测试器的Market Watch中)。
要求从每个所需的符号中获取任何数据。
他们由SymbolSelect()丢失 - 未被选中
亲爱的先生们 在向我推荐出版物之前(为此我感谢你们),请检查--你们的多币种是否在测试器中工作。
他们由SymbolSelect()丢失 - 未被选中
亲爱的先生们 在向我推荐出版物之前(为此我感谢你们),请检查--你们的多币种是否在测试器中工作。
它是有效的。在最新的构建中。一点问题都没有。
你是如何连接它们的(符号)--你能告诉我哪个功能吗?
你是如何连接它们的(符号)--你能告诉我哪个功能吗?
SymbolSelect(character name,true)。
SymbolSelect(character name,true)。
我也是这样做的。
我是这样理解的
2020.03.09 19:19:45.766 符号EURUSDrfd不存在。
2020.03.09 19:19:45.766 符号USDJPYrfd不存在
2020.03.09 19:19:45.766 符号AUDUSDrfd不存在
该电缆没有出现错误,因为它在测试器中被选中。
符号名称是正确的。
在我看来,它需要在终端设置本身做一些事情。如果在上次构建之前一切都在工作,那就与代码无关。测试员看不到这些符号。
2020.03.09 19:19:45.766 符号EURUSDrfd不存在。
2020.03.09 19:19:45.766 符号USDJPYrfd不存在
2020.03.09 19:19:45.766 符号AUDUSDrfd不存在
电缆没有出现错误,因为它在测试器中被选中。
它是什么?代码在哪里?你如何得到它?特别是你在选择完全不同的人物。
它是什么?代码在哪里?你如何得到它?特别是你选择了完全不同的角色。
明白了,我们这样走吧。
给定(人物名称)
代码(片段)
让我们选择测试器中的电缆作为例子。
运行它并
2020.03.09 19:19:45.766 符号EURUSDrfd不存在。
2020.03.09 19:19:45.766 符号USDJPYrfd不存在
2020.03.09 19:19:45.766 符号AUDUSDrfd不存在
电缆没有错误 - 它在测试仪中被默认选择。
在 "USDJPY "符号上创建iMA指标的例子,测试者在 "EURUSD "上运行。
结果是正确的。首先选择符号,然后用它创建指标。