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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

MT4 Order Pending Order/Order Modify Issue 1 reply

Please add Start Date / End Date to Basket Stats Indi 2 replies

FileOpen in Windows 7 3 replies

Does FileOpen lock the file to other processes 0 replies

MQL4 FileOpen function 2 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: How to set FileOpen to date of first order?
Cancel

How to set FileOpen to date of first order?

  • Post #1
  • Quote
  • First Post: Feb 27, 2017 4:11pm Feb 27, 2017 4:11pm
  •  yermommy
  • | Joined Jun 2015 | Status: Professional | 73 Posts
I'm currently attempting to make this code name my file after the date of the first opened order. I have tried using Order_Select to grab the first order by ticket, but I cannot get it to return the date of the order.

Inserted Code
handle=FileOpen("trades.csv",FILE_CSV|FILE_WRITE,",");

Could anybody please explain how I would do this? Thanks in advance.

Edit:
I've change "trades.csv" to
Inserted Code
(TimeToStr(OrderOpenTime())
but how do I make it return the value of the first ticket's time? Right now it just seems to return an arbitrary time.
  • Post #2
  • Quote
  • Feb 28, 2017 12:36pm Feb 28, 2017 12:36pm
  •  CodeMeister
  • Joined Sep 2009 | Status: Making Code While Making Pips | 1,672 Posts
I think the problem is the formatting of the time value. From your description I think uou should use TIME_DATE as the format. I believe the arbitrary time you are referring to is the number of seconds which is the default. So TimeToStr(OrderOpenTime(), TIME_DATE) should work.
 
 
  • Post #3
  • Quote
  • Last Post: Mar 2, 2017 1:33am Mar 2, 2017 1:33am
  •  yermommy
  • | Joined Jun 2015 | Status: Professional | 73 Posts
Quoting CodeMeister
Disliked
I think the problem is the formatting of the time value. From your description I think uou should use TIME_DATE as the format. I believe the arbitrary time you are referring to is the number of seconds which is the default. So TimeToStr(OrderOpenTime(), TIME_DATE) should work.
Ignored
Thank you, I will try to implement this method.
 
 
  • Platform Tech
  • /
  • How to set FileOpen to date of first order?
  • 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 / ©2023