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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Group Pairs EA, a request to EA coders. please help 2 replies

Guru EA Coders...Help me please... 3 replies

Margin, who can help me? coders come in please 0 replies

great coders please help 0 replies

Serious coders only please! 1 reply

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 1
Attachments: coders please fix an EA bug - trading hours
Exit Attachments
Tags: coders please fix an EA bug - trading hours
Cancel

coders please fix an EA bug - trading hours

  • Post #1
  • Quote
  • First Post: May 9, 2012 12:35pm May 9, 2012 12:35pm
  •  merlincocai
  • | Joined Nov 2011 | Status: Member | 31 Posts
Goof day,I have an EA which apparently has a bug in the trading hours algorithms,as I've set it 9-17,broker offset +2(which actually is my broker's GMT offset),but it opens trades outside the set trading time.Unfortunately,the coder who coded it for me doesn't answer my mails.Can somebody take a look at the code?Thanks for any suggestion.
Attached File(s)
File Type: mq4 RIB_EA.mq4   9 KB | 225 downloads
  • Post #2
  • Quote
  • May 10, 2012 3:21am May 10, 2012 3:21am
  •  futurespec
  • Joined May 2011 | Status: If you think I'm mad, I must be mad | 1,058 Posts
Merlin,
Sure is a Goofy day ;-)

Not sure but I think the following should work.....

Remove/overwrite the existing bool TradingTime() function with....
(keep a copy in case I am wrong)



bool TradingTime()
{
datetime start, stop;

start = StrToTime(StringConcatenate(Year(),".",Month(),".",Day()," ",StartTime))+GMT_Offset*3600;
stop = StrToTime(StringConcatenate(Year(),".",Month(),".",Day()," ",StopTime))+GMT_Offset*3600;

if(stop <= start)
stop += 86400;

if((TimeCurrent() >= start && TimeCurrent() < stop))
return(true);

return(false);
}
If you think I'm mad, I must be mad
 
 
  • Post #3
  • Quote
  • May 10, 2012 4:03am May 10, 2012 4:03am
  •  merlincocai
  • | Joined Nov 2011 | Status: Member | 31 Posts
Quoting futurespec
Disliked
Merlin,
Sure is a Goofy day ;-)

Not sure but I think the following should work.....

Remove/overwrite the existing bool TradingTime() function with....
(keep a copy in case I am wrong)



bool TradingTime()
{
datetime start, stop;

start = StrToTime(StringConcatenate(Year(),".",Month(),".",Day()," ",StartTime))+GMT_Offset*3600;
stop = StrToTime(StringConcatenate(Year(),".",Month(),".",Day()," ",StopTime))+GMT_Offset*3600;

if(stop <= start)
stop += 86400;

if((TimeCurrent() >= start...
Ignored
Thanks a lot futurespec,I'll try immediately.Unfortunately,since the EA doesn't trade very often,I don't know when I'll be able to let you know wheter your modification works or not.Thanks again.
 
 
  • Post #4
  • Quote
  • May 10, 2012 4:59am May 10, 2012 4:59am
  •  fxtr51
  • Joined Jan 2010 | Status: Member | 1,163 Posts
For that there is the strategy tester in Mt4.
 
 
  • Post #5
  • Quote
  • Last Post: May 10, 2012 5:48am May 10, 2012 5:48am
  •  merlincocai
  • | Joined Nov 2011 | Status: Member | 31 Posts
Quoting fxtr51
Disliked
For that there is the strategy tester in Mt4.
Ignored
I know,but my pc is under technical maintenance and my spare laptop is old and very poor of ram,so I can't run a backtest until the weekend.
 
 
  • Platform Tech
  • /
  • coders please fix an EA bug - trading hours
  • 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