Forex
Google

Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack (1) Thread Tools Display Modes
  #11 (permalink)  
Old 06-13-2007, 05:19 PM
MrPip MrPip is offline
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 551
MrPip is on a distinguished road
time setting

Time input should be chart time.

The error is caused by TakeProfit being less than 10. You can remove the check by deleting the lines at the beginning of the start function.

Robert
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 06-13-2007, 07:15 PM
jack2 jack2 is offline
Junior Member
 
Join Date: Jan 2007
Posts: 15
jack2 is on a distinguished road
I am sorry, I do not know which line to delete.

Even I set the profit target > 10, and when the time comes, the robot can't open any positions.

Anything wrong?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 06-14-2007, 05:12 AM
MrPip MrPip is offline
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 551
MrPip is on a distinguished road
New version

Quote:
Originally Posted by jack2
I am sorry, I do not know which line to delete.

Even I set the profit target > 10, and when the time comes, the robot can't open any positions.

Anything wrong?
I commented out the lines that check for TakeProfit.

It does check for the exact time to the minute so if there is no tick for the minute entered it will not place the trade.

Time must be entered as an integer.

For example 13:30 would be entered as 1330.

If there is no tick until 1331 the trade will not be entered.
I would be useful to have a time range begin and end for the trade to be placed so I added that as well. The default is a two minute window for trade to be entered.

Robert
Attached Files
File Type: mq4 TimeBasedEA.mq4 (3.1 KB, 122 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 06-14-2007, 06:37 AM
jack2 jack2 is offline
Junior Member
 
Join Date: Jan 2007
Posts: 15
jack2 is on a distinguished road
Quote:
Originally Posted by MrPip
I commented out the lines that check for TakeProfit.

It does check for the exact time to the minute so if there is no tick for the minute entered it will not place the trade.

Time must be entered as an integer.

For example 13:30 would be entered as 1330.

If there is no tick until 1331 the trade will not be entered.
I would be useful to have a time range begin and end for the trade to be placed so I added that as well. The default is a two minute window for trade to be entered.

Robert
I downloaded the latest EA here and the time format is correct but there were no trades opened also.

MrPips, mind to look into it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 06-14-2007, 06:49 AM
proverbs's Avatar
proverbs proverbs is offline
Member
 
Join Date: Jan 2007
Posts: 70
proverbs is on a distinguished road
This one will do what I think your looking for.

Hope this helps.
GBP9AM.mq4
__________________
Proverbs [James]
Faith in Jesus helps me to see the invisible, believe the incredible and receive the impossible!
He makes all things new in my life.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 06-14-2007, 07:05 AM
jack2 jack2 is offline
Junior Member
 
Join Date: Jan 2007
Posts: 15
jack2 is on a distinguished road
Quote:
Originally Posted by proverbs
This one will do what I think your looking for.

Hope this helps.
Attachment 35938
Thanks. It helps.

However, if I change the setting as follows (not using the default)

2007.06.14 15:30:35 GBP9AM EURUSD,M1 inputs: look_price_hour=7; look_price_min=31; close_hour=17; use_close_hour=true; take_profit=5; open_long=0; open_short=0; stop_long=0; stop_short=0; slippage=0; lots=0.1; magic=20051016;

None of the trades were opened. Why?

Last edited by jack2 : 06-14-2007 at 07:32 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 06-14-2007, 07:45 AM
jack2 jack2 is offline
Junior Member
 
Join Date: Jan 2007
Posts: 15
jack2 is on a distinguished road
I noted that this EA could not open at current market price. It must be on Stop.

Then if one of the trade executed, the other side will be closed.

Can it be modified not to close and to maintain there?

I need to open 3 Buy positions and 3 Sell positions at the same time at market price.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 06-14-2007, 09:16 AM
et_phonehome_2 et_phonehome_2 is offline
Senior Member
 
Join Date: Feb 2006
Posts: 1,085
et_phonehome_2 is on a distinguished road
If you want to open a trade at specific time, you either have to have the EA put in a market order or your pending order must be the a minimum number of PIPs away from the current price as dictated by your broker. You may want to look at one of those news EA.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 06-14-2007, 09:19 AM
jack2 jack2 is offline
Junior Member
 
Join Date: Jan 2007
Posts: 15
jack2 is on a distinguished road
Quote:
Originally Posted by et_phonehome_2
If you want to open a trade at specific time, you either have to have the EA put in a market order or your pending order must be the a minimum number of PIPs away from the current price as dictated by your broker. You may want to look at one of those news EA.
If the order should base on the market price at the time specified and must be executed. Thus, there is no number of pips away from the price.

The minimum exit target as required by broker is 5.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 07-03-2007, 02:52 PM
WNW's Avatar
WNW WNW is offline
Senior Member
 
Join Date: Feb 2006
Location: Motown, USA
Posts: 373
WNW is on a distinguished road
Can someone please create a version that will specify a long and short entry price ("1.1234", "1.4321") instead of a trigger?
I basically want to place 2 specific pending orders at a specific start time with an expiration, based on the "Daily 20 Pips" strategy.
Thanks for any help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/expert-advisors-metatrader-4/8067-help-how-write-simple-ea-buy-sell-specific-time.html
Posted By For Type Date
درخواست Indicator و expert - صفحه 84 - Sarmaye Forums This thread Refback 03-23-2008 11:36 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting price trend independent of a specific time frame gee Metatrader 4 4 02-24-2007 04:53 PM
Anyone want to write a simple EA? Kaper Suggestions for Trading Systems 6 10-29-2006 10:36 PM
A Simple Buy/Sell Script excite2 Expert Advisors - Metatrader 4 8 07-18-2006 03:16 AM
Simple question of determining the time of day Fishtank Metatrader 4 2 04-04-2006 04:12 AM


All times are GMT. The time now is 06:09 PM.