Placing stoploss above or below a reversal candle, eg doji or shooting star

To add comments, please log in or register
clinteas2
31
clinteas2  
Hi, I'm new to this and just wondering what functions in MQL4 I could use to make an EA place a stop loss above/below a reversal candle before the entry order is placed? Does anyone have some example code maybe? All help much appreciated, thank you!
Flavio Jarabeck
4036
Flavio Jarabeck  
clinteas2:
Hi, I'm new to this and just wondering what functions in MQL4 I could use to make an EA place a stop loss above/below a reversal candle before the entry order is placed? Does anyone have some example code maybe? All help much appreciated, thank you!
Why do you want to place a SL if there is no order in place yet?
clinteas2
31
clinteas2  
Minions Labs:
Why do you want to place a SL if there is no order in place yet?

Hi, I figured logically the stop placement would come before the order is placed. As in:

1. Criteria for "candle pattern" met

2. Place S/L x pips above/below "candle pattern" 

3. Place order


Is that wrong?

Flavio Jarabeck
4036
Flavio Jarabeck  
clinteas2:

Hi, I figured logically the stop placement would come before the order is placed. As in:

1. Criteria for "candle pattern" met

2. Place S/L x pips above/below "candle pattern" 

3. Place order


Is that wrong?

Yes, you cannot have a SL with no opened order... Just send the whole bunch (Order/SL/TP) in one call...

;)

clinteas2
31
clinteas2  
Flavio Jarabeck:

Yes, you cannot have a SL with no opened order... Just send the whole bunch (Order/SL/TP) in one call...

;)

thanks for that! So my question is, how do I capture the pattern candle upper/lower shadow price, so I know what the stop loss price has to be that I pass on to the order function?
Flavio Jarabeck
4036
Flavio Jarabeck  
clinteas2:
thanks for that! So my question is, how do I capture the pattern candle upper/lower shadow price, so I know what the stop loss price has to be that I pass on to the order function?

In the first place you have to know to how to program in MQL4. If it is not your EA I strongly suggest you to find some MQL4 programmer...

identifying candlesticks patter is easy, so you can include the code inside your EA, you need just to identify the diferences bewteen OPEN/CLOSE/HIGH/LOW of the previous candle...

So you just need to prepare your order with,  let's say, 1 or 2 ticks below/above the LOW/HIGH of the last (reversal) candle...

;)

Zee Zhou Ma
1919
Zee Zhou Ma  

You can place a SL order before an entry order is placed, by using a pending order with a SL. I wonder if this is a joke..


Reference: https://www.metatrader4.com/en/trading-platform/help/positions/orders

Order Types - Trading - MetaTrader 4 Help
Order Types - Trading - MetaTrader 4 Help
  • www.metatrader4.com
Client terminal allows to prepare requests and request the broker for execution of trading operations. Moreover, terminal allows to control and manage open positions. For these purposes, several types of trading orders are used. Order is a client's commitment to brokerage company to perform a trade operation. The following orders are used in...
To add comments, please log in or register