市场 / MetaTrader 5 / 实用工具 / Random Walk Chart FREE 已发布: 17 九月 2019 当前版本: 1.0 找不到合适的EA交易?请在自由职业者服务中订购您自己的EA交易 进入自由职业者服务 如何 购买 自动交易或指标 在 虚拟 主机运行您的EA 购买之前测试一个指标/EA交易 想要在市场 赚钱 吗? 如何介绍 用于流通销售的产品 概述 评分 (1) 评论 (3) 只有购买或租用产品的用户才可以进行评论 MARCOS Dos santos Moreira 2020.10.26 21:29 #1 O meu meta trade 5 não está vendendo mais os meus ativos me ajudem atenciosament Ian Worthington 2022.02.08 14:08 #2 Could you show source since you made this free anyway? Ivan Zaidenberg 2022.02.22 13:30 #3 WorthyVII #: Could you show source since you made this free anyway? #property script_show_inputs #property version "1.0" #property strict //--- Parameters input string SymName = "RandomWalk"; input int HistoryDepth = 1440; input int StartFrom = 100000; input bool VolaCycle = true; double open,high,low,close; string date,time; datetime TimeLoc; int Spread=1,random; ushort f=0; //+------------------------------------------------------------------+ //| Custom iteration function | //+------------------------------------------------------------------+ int OnStart(void) { int h=FileOpen(SymName+"."+IntegerToString(HistoryDepth)+".csv",FILE_WRITE|FILE_ANSI|FILE_CSV,";"); //--- if(h==INVALID_HANDLE) { Alert("Open File Fail"); return(-1); } //--- TimeLoc=TimeLocal(); MathSrand(TimeLoc); date=TimeToString(TimeLoc-HistoryDepth*60,TIME_DATE); time=TimeToString(TimeLoc-HistoryDepth*60,TIME_MINUTES)+":00"; open=StartFrom+RandomCoin(); close=open+RandomCoin(); high=MathMax(open,close); low=MathMin(open,close); FileWrite(h,date,time,open,high,low,close,1+(high-low),0,Spread); //--- for(int i=HistoryDepth-1; i>0; i--) { date=TimeToString(TimeLoc-i*60,TIME_DATE); time=TimeToString(TimeLoc-i*60,TIME_MINUTES)+":00"; if(VolaCycle) { open=close+Vola(time)*RandomCoin(); close=open+Vola(time)*RandomCoin(); } else { open=close+RandomCoin(); close=open+RandomCoin(); } high=MathMax(open,close); low=MathMin(open,close); FileWrite(h,date,time,open,high,low,close,1+(high-low),0,Spread); } //--- FileClose(h); Alert(TerminalInfoString(TERMINAL_DATA_PATH)+"\\MQL5\\Files\\"+SymName+"."+IntegerToString(HistoryDepth)+".csv"); //--- return(0); } //+------------------------------------------------------------------+ int RandomCoin() { int limit=32767; int sequence=0; for(int i=0; i<=limit; i++) { random=MathRand()-MathRand(); if(random>=0)random=1; if(random<0)random=-1; if(sequence==0) { sequence=random; continue; } if(random>0) { if(sequence>0) { sequence=sequence+random; continue; } if(sequence<0)break; } if(random<0) { if(sequence<0) { sequence=sequence+random; continue; } if(sequence>0)break; } } return (sequence); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int Vola(string t) { int res=1; int hh=StringToInteger(StringSubstr(t,0,2)); if(hh>=0&&hh<4)res=1; if(hh>=4&&hh<8)res=2; if(hh>=8&&hh<16)res=3; if(hh>=16&&hh<20)res=2; if(hh>=20)hh=1; return res; } //+------------------------------------------------------------------+ 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
MARCOS Dos santos Moreira 2020.10.26 21:29 #1 O meu meta trade 5 não está vendendo mais os meus ativos me ajudem atenciosament
Ivan Zaidenberg 2022.02.22 13:30 #3 WorthyVII #: Could you show source since you made this free anyway? #property script_show_inputs #property version "1.0" #property strict //--- Parameters input string SymName = "RandomWalk"; input int HistoryDepth = 1440; input int StartFrom = 100000; input bool VolaCycle = true; double open,high,low,close; string date,time; datetime TimeLoc; int Spread=1,random; ushort f=0; //+------------------------------------------------------------------+ //| Custom iteration function | //+------------------------------------------------------------------+ int OnStart(void) { int h=FileOpen(SymName+"."+IntegerToString(HistoryDepth)+".csv",FILE_WRITE|FILE_ANSI|FILE_CSV,";"); //--- if(h==INVALID_HANDLE) { Alert("Open File Fail"); return(-1); } //--- TimeLoc=TimeLocal(); MathSrand(TimeLoc); date=TimeToString(TimeLoc-HistoryDepth*60,TIME_DATE); time=TimeToString(TimeLoc-HistoryDepth*60,TIME_MINUTES)+":00"; open=StartFrom+RandomCoin(); close=open+RandomCoin(); high=MathMax(open,close); low=MathMin(open,close); FileWrite(h,date,time,open,high,low,close,1+(high-low),0,Spread); //--- for(int i=HistoryDepth-1; i>0; i--) { date=TimeToString(TimeLoc-i*60,TIME_DATE); time=TimeToString(TimeLoc-i*60,TIME_MINUTES)+":00"; if(VolaCycle) { open=close+Vola(time)*RandomCoin(); close=open+Vola(time)*RandomCoin(); } else { open=close+RandomCoin(); close=open+RandomCoin(); } high=MathMax(open,close); low=MathMin(open,close); FileWrite(h,date,time,open,high,low,close,1+(high-low),0,Spread); } //--- FileClose(h); Alert(TerminalInfoString(TERMINAL_DATA_PATH)+"\\MQL5\\Files\\"+SymName+"."+IntegerToString(HistoryDepth)+".csv"); //--- return(0); } //+------------------------------------------------------------------+ int RandomCoin() { int limit=32767; int sequence=0; for(int i=0; i<=limit; i++) { random=MathRand()-MathRand(); if(random>=0)random=1; if(random<0)random=-1; if(sequence==0) { sequence=random; continue; } if(random>0) { if(sequence>0) { sequence=sequence+random; continue; } if(sequence<0)break; } if(random<0) { if(sequence<0) { sequence=sequence+random; continue; } if(sequence>0)break; } } return (sequence); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int Vola(string t) { int res=1; int hh=StringToInteger(StringSubstr(t,0,2)); if(hh>=0&&hh<4)res=1; if(hh>=4&&hh<8)res=2; if(hh>=8&&hh<16)res=3; if(hh>=16&&hh<20)res=2; if(hh>=20)hh=1; return res; } //+------------------------------------------------------------------+
Could you show source since you made this free anyway?