Would like a script written please?

 

Hi There,

I am wondering if anybody can point me in the right direction or could create a script that does the following for me? I trade using FXCM MT4

I would like to be able to place an order at the market or an entry order.

3 contracts at a time

All contracts Stop Loss = -20 pips

1st Contract Take Profit at +20 pips

2nd Contracxt Take profit at +40 pips

3rd contract Take Profit at +100 pips

When the +20 pips is hit then move the remaining two contracts to Break even +1

I would also like to have the ability to adjust these values as I see fit.

Any help would be much appreciated

Cheers

Jason

 

sparklor wrote >>

I am wondering if anybody can point me in the right direction...

Here's something to get u started. Although note there is NO error handling whatsoever and no checks for proper stoploss/takeprofit values. Also, I don't remember if FXCM allows takeproft/stoploss to be entered with the market order. You might have to modify this to enter the order first and then use OrderModify() to add the stoploss/takeprofit. Note the values of the extern variables are in points. Anyway, c if this makes sense to u and ask further questions if it doesn't.


//+------------------------------------------------------------------+
#property show_inputs
//----
extern double  lots          = 0.1; 
extern double  stoploss      = 20;  
extern double  takeprofit_1  = 20;
extern double  takeprofit_2  = 40; 
extern double  takeprofit_3  = 100; 
//+------------------------------------------------------------------+
int start()
  {
//----
   OrderSend( Symbol(),OP_BUY,lots,Ask,5,Bid-stoploss*Point,Bid+takeprofit_1*Point );
   OrderSend( Symbol(),OP_BUY,lots,Ask,5,Bid-stoploss*Point,Bid+takeprofit_2*Point );
   OrderSend( Symbol(),OP_BUY,lots,Ask,5,Bid-stoploss*Point,Bid+takeprofit_3*Point );
//----
   return(0);
  }
//+------------------------------------------------------------------+

When the +20 pips is hit then move the remaining two contracts to Break even +1

This part is more suitable as an EA...

 

S

gordon wrote >>

I don't remember if FXCM allows takeproft/stoploss to be entered with the market order.
You might have to modify this to enter the order first and then use OrderModify() to add the stoploss/takeprofit.

This part is more suitable as an EA...


FXCM is ECN now, so you wont be able to put SL & TP with the initial order

With that and the stop movement plan, as Gordon says, this whole thing needs doing as an EA

Probably with an extern for OpenNow that defaults to false and is then set to true to launch the trade set

Good Luck

-BB-

Reason: