• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 11:43am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 11:43am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Basic Alt Key/Entry Script - Simplest Script Ever 1 reply

Really basic question about buy and sell orders 7 replies

Really basic rollover question 7 replies

Making Money and the Most Basic of All Basic Strategies 42 replies

Looking for a basic script... 15 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 1
Attachments: Really basic question about a Script
Exit Attachments

Really basic question about a Script

  • Post #1
  • Quote
  • First Post: May 24, 2008 7:30pm May 24, 2008 7:30pm
  •  dgrs
  • | Joined Jun 2007 | Status: Member | 92 Posts
I have a script which I downloaded from these forums and altered slightly to my needs. I want to further alter it, and save it as a new script. The indicator exports data to an excel file. However, I am concerned that if I just change the values I want to change (I want to export more candles of information in the new version) when I apply the script, the files created will have the same names as in the earlier version and hence write over those files. (the attached script saves the excel files as the same name each time so it just updates the information which is what I want) How do I change the code so that it creates excel files but of a different name?

Sorry for such a basic question.
Attached File
File Type: mq4 DGRSwithwkandmonth.mq4   5 KB | 244 downloads
  • Post #2
  • Quote
  • May 24, 2008 8:36pm May 24, 2008 8:36pm
  •  blueruby
  • Joined Feb 2007 | Status: Stock Broker, October 1987 | 1,299 Posts
Line 92, the "FileOpen" command. If you put your cursor on FileOpen and hit F1 it will explain the command.

The first thing it wants to see is a string that has the name of the file being created. The coder tied all this together into one string

"Exported"+symbol+periodDesc(period)+".csv"

so the filename will be: ExportedEURUSDH4.csv or something like that.

Note that he also calls a function called periodDesc to get the info into a certain format for the filename string.

So, to answer your question, just change the word "Exported" to something else.
 
 
  • Post #3
  • Quote
  • May 24, 2008 9:10pm May 24, 2008 9:10pm
  •  dgrs
  • | Joined Jun 2007 | Status: Member | 92 Posts
Thanks so much. That explains perfectly the most important aspect. Now I will go about cleaning it up. I am interested in keeping track of the average range of different periods. e.g. taking the last 100 candles into account, EURJPY moves on average 154 pips.

I use the script I posted to extract the information to a spreadsheet from which I calculated different pivot points and ranges.

It's all working ok but it's a shame it's a script. It doesn't seem to be possible to have an indicator so it all updates automatically.

Thanks again,

Dave
 
 
  • Post #4
  • Quote
  • May 24, 2008 10:32pm May 24, 2008 10:32pm
  •  blueruby
  • Joined Feb 2007 | Status: Stock Broker, October 1987 | 1,299 Posts
I'm sure it could be made into an indicator and would then write on every tick.
 
 
  • Post #5
  • Quote
  • May 24, 2008 10:35pm May 24, 2008 10:35pm
  •  blueruby
  • Joined Feb 2007 | Status: Stock Broker, October 1987 | 1,299 Posts
Quoting blueruby
Disliked
I'm sure it could be made into an indicator and would then write on every tick.
Ignored
Oops, wait a minute. I looked at the code and it goes back the whole chart when it's run. You don't want to do that every tick!

There are pivot point indicators that will do the calculation and draw the lines for you.
 
 
  • Post #6
  • Quote
  • May 25, 2008 7:18am May 25, 2008 7:18am
  •  dgrs
  • | Joined Jun 2007 | Status: Member | 92 Posts
Quoting blueruby
Disliked
Oops, wait a minute. I looked at the code and it goes back the whole chart when it's run. You don't want to do that every tick!

There are pivot point indicators that will do the calculation and draw the lines for you.
Ignored
Many thanks for your help. I do it in spreadsheet form so my charts don't get too cluttered. The cells in excel are conditionally formatted so when the prices gets near a level it lights up. Useful for showing when 4hrly, daily, weekly and monthly PP levels are simillar.

You're right I wouldn't want to do it every tick! The shortest time period I'm exporting is a 4hrly. Shorter timeframes I have charts. Do you think it would be possible to automatically update everytime a 4 hrly candle completes?

Also, forgive all the questions, I've looked through the script to try to work out where it tells excel that columns should have x titles. How can I change this? My new script is simply wanting to export highs and lows and time period (not bothered about open and close for this one) which I can do, but the columns keep the same titles.

Really appreciate your help.

Dave
 
 
  • Post #7
  • Quote
  • Last Post: May 25, 2008 6:51pm May 25, 2008 6:51pm
  •  blueruby
  • Joined Feb 2007 | Status: Stock Broker, October 1987 | 1,299 Posts
Looks like line 95 writes the headings.
 
 
  • Platform Tech
  • /
  • Really basic question about a Script
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022