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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Does markets closing/opening affect our trades? 9 replies

Alarms for opening, closing positions and pending order 4 replies

Closing and Opening same trades on different accounts 0 replies

Yesterday closing line and Today Opening Line Indicator 0 replies

True opening and closing hours? 16 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 1
Attachments: opening and closing trades on an EA
Exit Attachments

opening and closing trades on an EA

  • Post #1
  • Quote
  • First Post: Jan 17, 2007 9:43pm Jan 17, 2007 9:43pm
  •  Gmak
  • | Joined Aug 2006 | Status: High risk, low reward | 318 Posts
Hello,

I've been writing this EA for about a fortnight and I can get everything perfect except the following...

if a trade closes in a given bar/hour, I do not want the EA to open any trade in the selfsame bar/hour.

I have been tearing my hair out trying to think of what will probably be a simple solution, but my tiny mind is an enormous obstacle.

Can anybody help?
:confused: quote of the day: . It's like deja-vu all over again
  • Post #2
  • Quote
  • Jan 17, 2007 10:16pm Jan 17, 2007 10:16pm
  •  fourex
  • | Joined Nov 2006 | Status: Member | 17 Posts
Create a static variable that contains the opening time of the bar you closed your last trade in. If iTime(NULL,0,0) is equal to that value, don't allow another trade. 2 or 3 lines of code and it works perfect.
  • Post #3
  • Quote
  • Jan 17, 2007 11:12pm Jan 17, 2007 11:12pm
  •  Gmak
  • | Joined Aug 2006 | Status: High risk, low reward | 318 Posts
cheers fourex!!!
:confused: quote of the day: . It's like deja-vu all over again
  • Post #4
  • Quote
  • Jun 10, 2008 11:10pm Jun 10, 2008 11:10pm
  •  Pip Parade
  • | Joined Dec 2007 | Status: ... often wrong but never in doubt | 222 Posts
Different traders, Same question. But I'm afraid I've got a teenie tiny mind in my tiny head.

I've got the exact same question as Gmak but just have not been able to translate fourex's answer. So, teenie tiny mind.

Would someone mind translating this into the actual code needed to make it work and advising where in general it should go in an EA???

My thanks to all ...
Attached Image
  • Post #5
  • Quote
  • Last Post: Jun 11, 2008 7:24am Jun 11, 2008 7:24am
  •  Gnat
  • Joined Jun 2007 | Status: Unconventionable Conventionist | 2,768 Posts
Quoting Pip Parade
Disliked
Different traders, Same question. But I'm afraid I've got a teenie tiny mind in my tiny head.

I've got the exact same question as Gmak but just have not been able to translate fourex's answer. So, teenie tiny mind.

Would someone mind translating this into the actual code needed to make it work and advising where in general it should go in an EA???

My thanks to all ...
Ignored

Hey Pip Parade!!

Man - you are a beauty!!

Thanks for pointing me here!

Ciao!
Matt
  • Platform Tech
  • /
  • opening and closing trades on an EA
  • 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 / ©2021