Forex
Google

Go Back   Forex Trading > Downloads > Tools and utilities
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-09-2006, 12:13 AM
67-17454 67-17454 is offline
Senior Member
 
Join Date: Apr 2006
Location: Oregon
Posts: 112
67-17454 is on a distinguished road
Help: Simple Save Data To A File

I'm tinkering around trying to figure out how to send 15 minute data to a file. Any help would be appreciated.

It compiles without errors. I put it in the Indicator folder and it's visible, but when I try to add it in MT4, it's not accepted - does not get added to the EURUSD chart.

int start()
{
int handle;
string tSymbol="EURUSD";
double rates_m15[][6];
ArrayCopyRates(rates_m15,tSymbol,PERIOD_M15);
handle=FileOpen("Out.csv",FILE_CSV|FILE_WRITE,',') ;
if (handle<1)
{
Print("File Out.CSV not found, the last error is ", GetLastError());
return(false);
}
else
{
FileWrite(handle,tSymbol,TimeToStr(rates_m15[0][0]),rates_m15[0][1],rates_m15[0][2],rates_m15[0][3],rates_m15[0,4]);
FileClose(handle);
Alert("Sent Data File");
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-09-2006, 03:32 AM
Techguy's Avatar
Techguy Techguy is offline
Junior Member
 
Join Date: Nov 2005
Posts: 22
Techguy is on a distinguished road
Array Issue?

I'm just taking a wild stab here, but I thought that MT4 could only handle single element arrays. I thought I read that somewhere.

Also FYI, the compiler is not bullet proof. It seems to compile even though there may be issues in the code, i.e. datetime variables accidently declared as int.

Try the Metaquotes (manufacturer's) forum for researching the big bugs.
__________________
Kind Regards,

Techguy
Never Lose A Password

Last edited by Techguy : 05-09-2006 at 03:36 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-09-2006, 05:25 AM
elihayun's Avatar
elihayun elihayun is offline
Senior Member
 
Join Date: Jan 2006
Posts: 350
elihayun is on a distinguished road
I have 2 scripts that I wrote. the 1st one will write to the history, up to the datetime you can change. The 2nd will write to a CVS file. Hope it will help you
Eli
Attached Files
File Type: mq4 HistorySave.mq4 (3.0 KB, 72 views)
File Type: mq4 GetPrices.mq4 (1.5 KB, 79 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-09-2006, 05:44 AM
firedave's Avatar
firedave firedave is offline
Senior Member
 
Join Date: Nov 2005
Location: Jakarta, Indonesia
Posts: 416
firedave is on a distinguished road
Hi, sorry for asking this, maybe I'm just not quite understand the problem. But why need additional script to write to CVS file when we already have SAVE AS feature from MT4 ? Thank you in advance
__________________
David Michael H
"Trader helps traders with sincerity, honesty and integrity"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-09-2006, 07:11 AM
elihayun's Avatar
elihayun elihayun is offline
Senior Member
 
Join Date: Jan 2006
Posts: 350
elihayun is on a distinguished road
Quote:
Originally Posted by firedave
Hi, sorry for asking this, maybe I'm just not quite understand the problem. But why need additional script to write to CVS file when we already have SAVE AS feature from MT4 ? Thank you in advance
CVS files is great way to see the data in Excel. Not always, u want to see only the OCLH values. I use this script to save the MA or MACD values and analyze them afterwards.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-09-2006, 08:23 AM
firedave's Avatar
firedave firedave is offline
Senior Member
 
Join Date: Nov 2005
Location: Jakarta, Indonesia
Posts: 416
firedave is on a distinguished road
Quote:
Originally Posted by elihayun
CVS files is great way to see the data in Excel. Not always, u want to see only the OCLH values. I use this script to save the MA or MACD values and analyze them afterwards.
Understand, thank you for the reply
__________________
David Michael H
"Trader helps traders with sincerity, honesty and integrity"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-09-2006, 04:07 PM
67-17454 67-17454 is offline
Senior Member
 
Join Date: Apr 2006
Location: Oregon
Posts: 112
67-17454 is on a distinguished road
Did it

This did the trick. Thanks a lot.

I'm a better VB6 than 'C' programmer, so while I'm re-going through the learning curve (haven't programmed in 'C' since the mid-80s when I worked on Unix), I'm interacting between MT4 & VB6. I'm programming in the MMTS system from the e-Book - which I can do easily in VB6 with the interaction from MT4. I can also use a number of visual metaphors such as scoring the 19 different setups identified by Monika.

I know that I can use the DDE connection between MT4 & VB6, but this lets me leverage the MT4 system.

Thanks again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-09-2006, 06:19 PM
67-17454 67-17454 is offline
Senior Member
 
Join Date: Apr 2006
Location: Oregon
Posts: 112
67-17454 is on a distinguished road
Figured out problem

With the help of the other posts, I figured out the problem. I'm sure anyone looking at it knew and were just letting me struggle so I'd learn from it :-)

1) I didn't understand the difference between a script and an indicator. That's why MT4 wouldn't accept it.

2) I left out the "return(0)" at the end of the start() section.

MarkC.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 07-01-2008, 04:20 PM
kenleyl kenleyl is offline
Junior Member
 
Join Date: Dec 2005
Posts: 2
kenleyl is on a distinguished road
write historical indicator values to a csv?

I am plotting objects at various times on a chart and would like to know how to get various indicator values for the points in time where the objects are plotted. Similar to the data window feature in MT4.

Example - if I create an arrow object on a chart as follows:

ObjectCreate("buy_arrow", OBJ_ARROW, 0, D'2008.06.30 3:30', 1.5785)

How can I get rsi value for the exact point where that object lives on the chart?

Thanks,
Ken
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 07-22-2008, 05:19 PM
forexsvoboda forexsvoboda is offline
Junior Member
 
Join Date: Jul 2008
Posts: 2
forexsvoboda is on a distinguished road
iExposure - indicator - excel....

Hello.

I have one question. How to get data from indicator iEXposure to excel....How can it I transfer direct to the excel tabele...

I now to used the current data in excel (like: =MT4|BID!EURUSDm....)

I need, that i can transfer data from deals, buy, sell and so one....

Please, could me someone help by this problem?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can an EA save to and read from a preset file? ZTrader Questions 0 03-05-2007 09:35 PM
How to save to *.TXT file thanhhaf2003 Metatrader 4 mql 4 - Development course 1 02-11-2007 07:41 PM
What is .set file? maniek Questions 0 03-31-2006 08:20 PM
Mt3 EXP file forexpipmaster General Discussion 7 02-03-2006 05:17 PM


All times are GMT. The time now is 07:47 AM.