算法的优化。 - 页 10 1...345678910 新评论 Andrey Dik 2020.07.12 23:36 #91 Igor Makanu:你的例子不是一个组合,而是一个没有重复的permutation而我的例子是一个没有重复的连词。 哦,所以这就是它应该有的样子? 0 1 01 11 001 101 011 ... 那么代码对你来说就不会太复杂,但你肯定不需要那么多循环。 Igor Makanu 2020.07.12 23:44 #92 Andrey Dik:哦,原来是这样的计划? 是 我不得不在测试器中生成文件名,每个文件是一个策略参数 通过生成没有重复的组合,所有的TS组合都被组合起来,在主题的最后一页,有这样的代码 你的问题很容易在谷歌上搜索到 "无重复递归的排列组合S++" Andrey Dik 2020.07.12 23:49 #93 Igor Makanu:而你的问题很容易在谷歌上搜索到 "无递归递归的permutations C++"。 我在谷歌上搜索了一下,但大多没有出现普遍的解决方案。 但自己做并弄清楚它要有趣得多,信息量也大得多)。 Aliaksandr Hryshyn 2020.07.13 15:45 #94 Andrey Dik:我可以得到代码吗? input int StartN = 5; input int EndN = 7; input int CountN = 4; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnStart() { for(int i1=0; i1<30; i1++) { Print(CombinationGenerator(i1,StartN,EndN,CountN)); } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ string CombinationGenerator(uint iteration_index,int startN, int endN, int countN) { string result; int base=endN-startN+1; uint ml=base; for(int i1=0; i1<countN; i1++) { uint md=iteration_index%base; result=result+string(md+startN); iteration_index=(iteration_index-md)/base; } return result; } 这很简单。 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5555 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6555 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7555 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5655 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6655 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7655 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5755 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6755 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7755 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5565 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6565 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7565 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5665 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6665 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7665 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5765 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6765 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7765 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5575 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6575 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7575 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5675 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6675 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7675 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5775 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6775 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7775 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 5556 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 6556 2020.07.13 16:45:27.456 test3 (EURUSD,M1) 7556 Andrey Dik 2020.07.13 17:10 #95 Aliaksandr Hryshyn:这很简单。 很好,谢谢!我去看看。 1...345678910 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
你的例子不是一个组合,而是一个没有重复的permutation
而我的例子是一个没有重复的连词。
哦,所以这就是它应该有的样子?
0
1
01
11
001
101
011
...
那么代码对你来说就不会太复杂,但你肯定不需要那么多循环。
哦,原来是这样的计划?
是
我不得不在测试器中生成文件名,每个文件是一个策略参数
通过生成没有重复的组合,所有的TS组合都被组合起来,在主题的最后一页,有这样的代码
你的问题很容易在谷歌上搜索到 "无重复递归的排列组合S++"
而你的问题很容易在谷歌上搜索到 "无递归递归的permutations C++"。
我在谷歌上搜索了一下,但大多没有出现普遍的解决方案。
但自己做并弄清楚它要有趣得多,信息量也大得多)。
我可以得到代码吗?
这很简单。
这很简单。
很好,谢谢!我去看看。