Export CSV with Moving Average data

 

I'd like to export the CSV file with the usual Date, Time, Open .... , but also with several different Moving Average information. I've got 5 different moving averages plotted on chart, but when I export data I don't get it on the "csv" file.

 

You could write an EA to write the information to a text file and format it anyway you like. The run it through strategy tester for the dates you require.

There might be another way but that would work.

Hope that helps.

Lux

 

Maybe...

We have some indicators that export data into CSV format.

Like this, or this.

Maybe you could modify some of them to use iMA function, call the data value you need, record, and then DoubleToStr.

Its just theory, not sure if could work.

 

Moving Average Function

HELP... what is function to call the MA value plotted in a separate window???

The iMA function could only call Value of MA from the main_chart window. How do i call the MA Value that is on a separate windows???

Thanks anyone...

 
PipScorer:
HELP... what is function to call the MA value plotted in a separate window???

The iMA function could only call Value of MA from the main_chart window. How do i call the MA Value that is on a separate windows???

Thanks anyone...

You need to call the value of the indicator, not the iMA.

Example (pretty ugly):

When you drop some MA with default settings into main chart window the MA is based on the bars/candle values

When you drop some MA with default settings into separate chart window and the MA is based on the values of a previous dropped indicator. You would have a MA of some indicator.

This generates the data that you need to call.

If you only changed the position of some MA from main chart to windows chart still is only a MA or iMA.

 
Linuxser:
You need to call the value of the indicator, not the iMA.

Example (pretty ugly):

When you drop some MA with default settings into main chart window the MA is based on the bars/candle values

When you drop some MA with default settings into separate chart window and the MA is based on the values of a previous dropped indicator. You would have a MA of some indicator.

This generates the data that you need to call.

If you only changed the position of some MA from main chart to windows chart still is only a MA or iMA.

Thanks so much

 

Here you go.

This should help a bit. Even if you don't know what anything means in the code, as long as you can visually locate the different commands for iMACD and iMA, you can edit the heck out of this. Just understand that if you change it at the top, you'll need to change it at the bottom in the FileWrite commands as well.

I'm working on automating it so it exports once an hour and just overwrites the existing csv file.

This one exports the 32, 64 and 200 period moving average values for M15, H1, H4 and D1. It also exports the MACD values from the last 4 bars on M15, H1, H4 and D1.

R

Files:
ma_macd.mq4  77 kb
Reason: