Working with Excel (tools, indicators, conversion ...) - page 9

 
dgrspencer:
Many thanks for this. Right I can now import the required manually!

However, I'm struggling with automatically importing the data. I can import (via DDE) current price, and I've read what the MT4 help file says, but there's nothing about importing a close price automatically on the completion of a candle. Nor is there anything about specifying the High Low period, it just mentions the TIME function is something that you can use.

Really appreciate the help.

Dave

Try the script and the excel . It is currently setup for Interbank FX. Run the script. Have the Interbank MT4 open before opening the Excel(extract the excel straight into th C: drive and open it from there no folder or subfolders). Click the Update button H1 and D1 and you are on your way. Don't think the import of csv files can be fully automated.

 

even more basic

Great thanks. Looks like I'm getting closer and closer. Forgive my stupidity, but I run the script in Metaeditor, compile it, save it in the Indicators folder but then it doesn't appear. I'm pretty new at this, any help very much appreciated.

Dave

 
dgrspencer:
Great thanks. Looks like I'm getting closer and closer. Forgive my stupidity, but I run the script in Metaeditor, compile it, save it in the Indicators folder but then it doesn't appear. I'm pretty new at this, any help very much appreciated. Dave

Actually it is a script you put it in the /experts/scripts folder.When you put it on the chart it executes and .Writes the files thats it.Nothing except the popup window appears on your chart informing you of the the progress.

Check your Mt4 folder and experts/files there you should have the files.

Each time you want to update you have to run the script again.

You could place it into the expert folder and load it from there put then you have it writing the files with every tick maybe with a sleep function would set it to execute at set times>

 

Constant beeping

Really appreciate your help. Right I've put it in the Scripts folder and then I just dragged and dropped it onto a chart (is this how you do it?) and then an alarm bell rang saying 'local history files are being updated from the server'. However this bell is going off every few seconds.

When I opened up the excel sheet you kindly posted (with MT4 running in the background) and I clicked on one of the update buttons it displays an error message asking whether I want to debug the program.

I'm a little confused as to what the file does that you've sent me. Does it collate the data I want in an easier fashion (ie rather than exporting a csv file?) for excel to then import?

Thanks again,

Learning lots by the hour!

 
dgrspencer:
Really appreciate your help. Right I've put it in the Scripts folder and then I just dragged and dropped it onto a chart (is this how you do it?) and then an alarm bell rang saying 'local history files are being updated from the server'. However this bell is going off every few seconds.

When I opened up the excel sheet you kindly posted (with MT4 running in the background) and I clicked on one of the update buttons it displays an error message asking whether I want to debug the program.

I'm a little confused as to what the file does that you've sent me. Does it collate the data I want in an easier fashion (ie rather than exporting a csv file?) for excel to then import?

Thanks again,

Learning lots by the hour!

The beeping will stop as soon all files are created.

The update error is telling me that the files can't be located or are not created. Wndows Vista does write the files in a different location.

1 Do you use Windows Vista or XP?

2 Are you using interbank FX?

else the code in the script neeeds to be edited by removing the(m) after each currency nomination.

3 Are the csv files created in the expert/files folder ?

4 did you unzip the excel into the C: drive? it would make things easier otherwise all formulas in the excel need to be altered.

 
Forexcashman:
The beeping will stop as soon all files are created.

The update error is telling me that the files can't be located or are not created. Wndows Vista does write the files in a different location.

1 Do you use Windows Vista or XP?

2 Are you using interbank FX?

else the code in the script neeeds to be edited by removing the(m) after each currency nomination.

3 Are the csv files created in the expert/files folder ?

4 did you unzip the excel into the C: drive? it would make things easier otherwise all formulas in the excel need to be altered.

1. I use XP (I don't like Vista!)

2. I wasn't so have removed the "m's"

2. Yes the csv files are being created

4. Yes it is now unzipped into C: (no folder)

what do I do now?(!) The spreadsheet is only for the AUD/JPY

Dave

 

1. I use XP (I don't like Vista!)

2. I wasn't so have removed the "m's"

2. Yes the csv files are being created

4. Yes it is now unzipped into C: (no folder)

Ok, now you have a tool to create the files.Alter the script line 16 to the currencies you like to work with.In line 163 you change the amount of data for each time frame.Lin 40-45 47-53 take out the periodes you don't need and compile it.

re. excel

Yes it is only for one currency now you go and extend and copy the sheet and replace AUDJPY with the currency you like to add.Once you've done that and it doesn't work post it and I'll help you from there.

 
dgrspencer:
1. I use XP (I don't like Vista!)

2. I wasn't so have removed the "m's"

2. Yes the csv files are being created

4. Yes it is now unzipped into C: (no folder)

Ok, now you have a tool to create the files.Alter the script line 16 to the currencies you like to work with.In line 163 you change the amount of data for each time frame.Lin 40-45 47-53 take out the periodes you don't need and compile it.

re. excel

Yes it is only for one currency now you go and extend and copy the sheet and replace AUDJPY with the currency you like to add.Once you've done that and it doesn't work post it and I'll help you from there.

Great! I've done all of that - changed the codes to suit my set up and it now works. The files are being created. think I now have a problem with the spreadsheet. This is the command line in excel

='C:\Program Files\Interbank Fx Trader 4\experts\files\[ExportedAUDJPYmH1.csv]ExportedAUDJPYmH1'!B3

Now I've changed this to;

='C:\Program Files\MetaTrader 4\experts\files\[ExportedEURJPYH4.csv]ExportedEURJPYH4'!B3

So I've changed;

1. where my MT4 is

2. AUDJPY to EURJPY (as it's one of the pairs I've chosen to export)

3. removed the "m's"

4. the time scale - 4hours is one of my time frames so H1 changed to H4

When I do all of this I'm told that 'Excel cannot update one or more links in this work book' etc.

When I then go to Edit>Links I get into territory beyond my understanding - I really do appreciate your help.

What I am still slightly confused about is what I'm trying to achieve here. I think that, say for 4 hourly data, I will have to drag my script over a chart to get the data and then click on the macro button on the spreadsheet to update it all. This is fancy and cool and I want to be able to do it! However, it's only slightly more convenient than exporting all the historical data to a sheet as a csv file and then using that info. Am I missing something? The only realy irritating thing about exporting the history is I can't work out how to export a few candles worth of information so I end up with thousands of records.

Dave

 

='C:\Program Files\MetaTrader 4\experts\files\[ExportedEURJPYH4.csv]ExportedEURJPYH4'!B3

So your Broker's MT4 is only called MetaTrader 4. Usually they use There company name like Alpari or WHC.?

When I then go to Edit>Links I get into territory beyond my understanding - I really do appreciate your help.

Now you have to edit the entries in the Macro as well as it is still looking for interbank FX and for the H1 and D1 csv.

What I am still slightly confused about is what I'm trying to achieve here. I think that, say for 4 hourly data, I will have to drag my script over a chart to get the data and then click on the macro button on the spreadsheet to update it all. This is fancy and cool and I want to be able to do it! However, it's only slightly more convenient than exporting all the historical data to a sheet as a csv file and then using that info. Am I missing something?

If you require only the H4 of 1 currency then yes it is only slightly more convenient.

The only realy irritating thing about exporting the history is I can't work out how to export a few candles worth of information so I end up with thousands of records.

Can you be more specific I don't understand what your are trying to achieve?

 
Forexcashman:
='C:\Program Files\MetaTrader 4\experts\files\[ExportedEURJPYH4.csv]ExportedEURJPYH4'!B3

So your Broker's MT4 is only called MetaTrader 4. Usually they use There company name like Alpari or WHC.?

When I then go to Edit>Links I get into territory beyond my understanding - I really do appreciate your help.

Now you have to edit the entries in the Macro as well as it is still looking for interbank FX and for the H1 and D1 csv.

What I am still slightly confused about is what I'm trying to achieve here. I think that, say for 4 hourly data, I will have to drag my script over a chart to get the data and then click on the macro button on the spreadsheet to update it all. This is fancy and cool and I want to be able to do it! However, it's only slightly more convenient than exporting all the historical data to a sheet as a csv file and then using that info. Am I missing something?

If you require only the H4 of 1 currency then yes it is only slightly more convenient.

The only realy irritating thing about exporting the history is I can't work out how to export a few candles worth of information so I end up with thousands of records.

Can you be more specific I don't understand what your are trying to achieve?

I simply downloaded my MT4 from metaquotes.net.

What I am trying to achieve is a spreadsheet which automatically calculates 4hrly, daily, weekly and monthly pivots. Actually I don't use them directly for trading but I like to know where a position I may take fits into pivot points. I have conditionally formatted cells to light up colours when the price (I have a live price feed into the spreadsheet) gets within a certain number of pips.

I can export the history from MT4 (creates a csv file just as your script does) but I get the entire history within MT4 - thousands of candles worth of info. Obviously to calculate pivots I only need the most recent ones - hope that clears up what I was saying before.

However, having played around a bit I love the idea behind what your helping me with. Drag the script onto a chart (repeated ever 4 hours) then click on a macro button to automatically update my spreadsheet. This is a much slicker way!

Have I cleared things up a bit?

Continued thanks