Automatic 10 Pip Stop Loss with One-Click Trading in MT4

 

Hi,

I'll keep this quick. I am a scalper and use MT4 through my broker (they don't use MT5, yet) and i am looking for one very specific program: something that can add a set amount of pips lets say 10 pips as an automatic stop loss when i open trade with the One-Click trading function.

I have found some EA's for MT5 but none yet for MT4. I need a program like this as i need to a SL in place once i enter quickly for extra safety. Any help would be greatly appreciated. Thank you very much.

 
gali226I'll keep this quick. I am a scalper and use MT4 through my broker (they don't use MT5, yet) and i am looking for one very specific program: something that can add a set amount of pips lets say 10 pips as an automatic stop loss when i open trade with the One-Click trading function. I have found some EA's for MT5 but none yet for MT4. I need a program like this as i need to a SL in place once i enter quickly for extra safety. Any help would be greatly appreciated. Thank you very much.

You can either:

  1. Learn to code it yourself,
  2. or search the CodeBase for such a solution,
  3. or search the Market for such a product,
  4. or place a job request at the Freelance section and get the project made exactly to your specifications.
 
gali226:

Hi,

I'll keep this quick. I am a scalper and use MT4 through my broker (they don't use MT5, yet) and i am looking for one very specific program: something that can add a set amount of pips lets say 10 pips as an automatic stop loss when i open trade with the One-Click trading function.

I have found some EA's for MT5 but none yet for MT4. I need a program like this as i need to a SL in place once i enter quickly for extra safety. Any help would be greatly appreciated. Thank you very much.


Hi gali,

Here you go.

Files:
AutoStop.mq4  3 kb
 
Fernando Carreiro:

You can either:

  1. Learn to code it yourself,
  2. or search the CodeBase for such a solution,
  3. or search the Market for such a product,
  4. or place a job request at the Freelance section and get the project made exactly to your specifications.
Or find someone trying to build a reputation
 
nicholish en #:

Hi gali,

Here you go.

Hey, I've tried to use this but it is only working for sell orders?

Is there something I can change to make this work :D

Thanks, Jay

 
Jesse Vaughn #:

Hey, I've tried to use this but it is only working for sell orders?

Is there something I can change to make this work :D

double stop = OrderType() == OP_BUY?OrderOpenPrice()-m_stop_points*_Point:OrderOpenPrice()+m_stop_points*_Point; 

Change the two OrderOpenPrice to OrderClosePrice.

You buy at the Ask and sell at the Bid. Pending Buy Stop orders become market orders when hit and open at the Ask.

  1. Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?

  2. Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger close to a specific Bid price, add the average spread.
              MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25

  3. The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)
    Most brokers with variable spreads widen considerably at end of day (5 PM ET) ± 30 minutes. My GBPJPY shows average spread = 26 points, but average maximum spread = 134 (your broker will be similar).

Reason: