extern string currencypair = "EURUSD"; void opens() { double thisweeksopen, lastweeksopen, twoweeksagoopen; thisweeksopen= iOpen(currencypair,10080,0); lastweeksopen = iOpen(currencypair,10080,1); twoweeksagoopen= iOpen(currencypair,10080,2); do number crunching return; }
Thanks, I will give that a try.
OK, I tried that, and it does get the data, but it runs for every bar in the time frame of the advisor. Basically I only need the data one time, and it seems that I can't run W1 on the simulator, only D1.
I guess I need some date logic to pass in somehow. That is why I was wondering about this.
I am thinking that it needs to be an expert advisor so I can automate this in the end.
OK, I tried that, and it does get the data, but it runs for every bar in the time frame of the advisor. Basically I only need the data one time, and it seems that I can't run W1 on the simulator, only D1.
I guess I need some date logic to pass in somehow. That is why I was wondering about this.
I am thinking that it needs to be an expert advisor so I can automate this in the end.
Yes I misunderstood your question I posted that code as for use in an EA.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Sorry for the vague title, this is more about tools than a specific question
Previously, I imported stats into an Oracle DB, and could do what I wanted by querying the database and etc.
Now, I want to do the same modeling in mql, but I am running into a conceptual problem
It seems that everything is related to the current chart, and I don't want that. What I want is a program that can search for previous data and then calculate based on those data.
Sure, I would eventually like it to put in trades based on the data, but at this point I would just like to get some accurate data back.
EA's don't work because they aren't date bound in the real sense (i.e. I want last weeks open and the week before thats open), I can't seem to do that without running through every tick/open.
Scripts don't work because they have to run on a specific chart, and indicators don't seem to work either.
Is there a way to launch a program that does not rely on anything in the window or a certain chart? Maybe I am missing something, but it seems like that would be the point of this.
Psuedo code would be
find previous weeks open
find previous previous weeks open
Store them in vars and then do some number crunching
Of course this is overly simplified, but everything I do is based on data, I don't do any charting, and don't plan to. My system doesn't rely on any charts or TI.
Maybe this isn't the tool I need, but I would like to automate at some point when the algo is complete.
Thanks, and sorry for the long post, I am just seriously wondering what to do next.