EA request for trading 4 majors

 

Hello,

Can a programmer please write the following EA:

Open trade at XX:XX GMT

Close trade at XX:XX GMT

Take profit

Stop Loss

Trade direction (long or short)

MM (switch to turn off & on)

Fixed lot size

The idea is from another thread here on this forum. It opens trades at 00:00 GMT all the same direction for the GBP/USD, EUR/USD, USD/CHF, & USD/JPY with fixed take profit and stop loss (60 & 40 respectively). The position will be closed at 23:59 if still opened regardless of profit or loss. Thank you and please let me know if you have questions. Attached is trading since 10/18/07.

Files:
 

Thank you very much for programming the EA. I will load this evening and report back any problems. As far as MM, we could set X% (ex: 5%) of the account to risk and have a switch to turn it off and on. If turned on, it would override the fixed lots.

Update statement:

Files:
 

Could you please also add a feature to close all open orders for Friday before the market closes so we don't carry any trades into the weekend. Thank you.

 
lcfxtrader:
Could you please also add a feature to close all open orders for Friday before the market closes so we don't carry any trades into the weekend. Thank you.

Could you not just manually change the close Hours in the EA on Friday so they close just before market close? How long have you been using this system? Does it matter if you select Buy for the day or Sell? So open and close hours are GMT, correct? So for me IBFX use GMT hours so I wont need any GMT shift in the EA, correct? but others might need a GMT shift for their broker if their broker time is different than GMT. Can that be added to the EA as well?

EDIT: also what about selecting TradeDir=2, does that mean the EA decide what direction to trade in?

extern int TradeDir=1; //1 =Buy, 0=Sell, 2=Both direction

and if all trades close from hitting take profit or stoploss, do we open more trades. or only open ONE trade per currency per day?

 

Could you not just manually change the close Hours in the EA on Friday so they close just before market close? Yes, but I prefer a "hands off" approach if possible.

How long have you been using this system? Started on 10/18/07 (see statement).

Does it matter if you select Buy for the day or Sell? I prefer going long for all pairs, but it's not written in stone. It would be up to the trader to decide.

So open and close hours are GMT, correct? Correct, I try to open all positions at 00:00GMT (start of a new daily candle). This is one reason I requested the EA for consistancy day in and day out.

So for me IBFX use GMT hours so I wont need any GMT shift in the EA, correct? but others might need a GMT shift for their broker if their broker time is different than GMT. Can that be added to the EA as well? Answer would come from the programmer.

EDIT: also what about selecting TradeDir=2, does that mean the EA decide what direction to trade in?

extern int TradeDir=1; //1 =Buy, 0=Sell, 2=Both direction

Answer would come from the programmer.

and if all trades close from hitting take profit or stoploss, do we open more trades. or only open ONE trade per currency per day? One trade per day.

 

Interesting approach. How long has this method been forward tested?

 

So you wouldn't start on Sunday open, correct? You'd wait until Monday 0:00GMT

Maybe we could have a feature in the EA that can check the close candle of the previous day so if going up then place Long trade and if going down place Short trade.

Thanks

 

EA upgrades

lcfxtrader:
Thank you very much for programming the EA. I will load this evening and report back any problems. As far as MM, we could set X% (ex: 5%) of the account to risk and have a switch to turn it off and on. If turned on, it would override the fixed lots. Update statement:

Awright

Thank you for sharing such a simple yet powerfull method,

i've attached the EA at the #2 post, edited the post to see the history of the creation

Please feel free if you need to ask / adjust anything again..

 

trying to code

Hi there,

been trying to code your requirement, but you didn't mention on the MoneyManagement things..how should the EA performs money management..

i've attached the EA bellow, please feel free to ask for any improvement it should have..

here are the input :
  • OpenPosHour=0;
  • This is the time in HOUR you want to open for a positition

  • OpenPosMinute=0;
  • This is the time in MINUTES you want to open for a position

    so combining the OpenPosHour and OpenPosMinute should resemble HH:MM

  • ClosePosHour=23;
  • ClosePosMinute=59;
  • TP=60;
  • SL=40;
  • TradeDir=1; //1 =Buy, 0=Sell, 2=Both direction
  • LotSize=0.1;
  • ****updates 9-Nov-07

  • MM=5
  • This is where you would like to set your risk acceptance (in percent), the default is 5 means : you are willing to put 5% of your equity for one trade

  • CarryWeekend=false;
  • This where you specify should the EA close all trades when the market ends for the week

regards,

 
yohanip:
Awright Thank you for sharing such a simple yet powerfull method,

i've attached the EA at the #2 post, edited the post to see the history of the creation

Please feel free if you need to ask / adjust anything again..

Thank you for the update, but what time in GMT is you EA set to close all trades on Friday? IBFX closes at 19:56 GMT. Do all brokers close for the weekend at this time? I think StrategyBuilder FX closes at different times ??

What does select option 2 mean?;

TradeDir=1; //1 =Buy, 0=Sell, 2=Both direction

Can your EA be programed for what I mentioned in my previous post? Might help it determine if it should select Long or Short for the day.

EDIT2: IBFX closes just before 20GMT so should I change;

if(TimeHour(TimeCurrent())==20)//asuming that every server time will be at end when the time reaches 20:00

[/code]

to

[code]

if(TimeHour(TimeCurrent())==19:50) //asuming that every server time will be at end when the time reaches 20:00

also, can you make MM optional True/False. Thanks

 

I personally would not trade the Sunday candle and would wait until the Monday candle. I think the EA would allow the user to input your server's time for the start & end of the daily candle. The exception would be for the EA to close any open orders on Friday before the market closes. This would need a separate input otherwise you would need to manually change the close time every Friday when the order is initally placed. This method has been forward tested since 10/18/07. See statement for today’s results.

Files:
Reason: