[A] One Bar Pending Order
Set your open price also your close price stop-loss
- Send the pending ticket with the target open price, using the last decimal of the OP as the time frame code.
(The open price also serves as the close price stop-loss.)
Why place one bar pending order?
This is the simplest ticket you can send with this EA. It sets the open price and the close price stop-loss at the same level. The ticket will close when one bar closes against the direction you are trading. This strategy is generally used when you identify a potential highest or lowest price, such as an important support or resistance level, and want to enter a position to see if the price bounces back from that level.
Where to use?
You can use this entry strategy at the highest point of an M top or the lowest point of a W bottom. Since the stop-loss is set at the same level as the open price, the ticket will close immediately if the price moves against your desired direction. The advantage of this strategy is that you can place a ticket with a larger lot size while still keeping the loss per ticket manageable. By using this type of ticket, you generally achieve the highest risk-to-reward ratio. Additionally, it typically doesn’t take long to see whether your stop-loss will be triggered or if the market will start moving in your preferred direction.
money-to-risk-per-ticket
to reduce over-lossOver-loss may occur when the stop-loss distance is short (e.g., a one-bar pending order) or when trading with a small stop-loss timeframe (e.g., M1). If you consistently encounter over-loss, try slightly reducing the money-to-risk-per-ticket
. For example, if you set 30 USD as your risk amount and the average loss is consistently larger than this amount, you can reduce it to 25 USD or 20 USD and test it over several attempts.
How to Place the Ticket?
Placing a single-bar stop-loss pending ticket is very easy. For a buy ticket, identify the lowest potential support level, and for a sell ticket, identify the highest potential resistance level. Next, place a buy or sell limit ticket with only the open price, setting the last decimal of the open price as the TF code (this is the only case where we use the last decimal of the open price instead of the stop-loss price as the time frame code). After sending the pending order, simply wait for the market price to trigger the order. The utility will close the ticket for you when the close price breaches the stop-loss level (which is the same as your open price) you set. Here we provide some example for you to get familiar with this feature:
[Example 1]
Entering a Single-Bar Stop-Loss Pending Order with a Buy Ticket for XAUUSD at 2381.28, using M1 as the stop-loss timeframe based on the close price.
- Floor the last decimal of 2381.28 to get 2381.20.
- Set the M1 time frame code of 1 into the last decimal, so the open price will be 2381.21.
- After sending the pending ticket, you will see your stop-loss on your MT4 mobile app set to 0.01. This indicates that the close price stop-loss has been set to the open price.
[Close Price Stop-Loss]
The price of 2381.20 (the floored price of 2381.21) will be set as the close price stop-loss. This will create a difference between the stop-loss you intended to set (2381.28) and the actual stop-loss (2381.20).
[Example 2]
Entering a Single-Bar Stop-Loss Pending Order with a Sell Ticket for EURUSD at 1.08915, using M15 as the stop-loss timeframe based on the close price.
- Round up (ceil) the last decimal of 1.08915 to get 1.08920.
- Set the M15 time frame code of 3 in the last decimal, so the open price will be 1.08923.
- After sending the pending ticket, you will see your stop-loss on your MT4 mobile app set to 9999.00003, indicating that the open price has also been set as the stop-loss.
[Close Price Stop-Loss]
The price of 1.08930 (the rounded-up price of 1.08923) will be set as the close price stop-loss. This will create a difference between the intended stop-loss (1.08915) and the actual stop-loss (1.08930).
[Advanced Technique]
In this example, you could also send 1.08913 as the open price, so the final close price stop-loss would be 1.08920, which is closer to your original target stop-loss.
How is the close price stop-loss calculated?
For a buy order, the stop-loss is set at the floor price of the last decimal place. For a sell order, the stop-loss is set at the ceiling price of the last decimal place.
How to Send a Direct Market Order with the Optimal Lot Size When the Open Price is Too Close to Your Stop-Loss?
Sending a pending order when the open price is too close to your stop-loss may not be possible, as some brokers restrict users from setting the open price and stop-loss too close to each other. Generally, this distance has to be at least 20 pips. If you want to enter a position when the current market price is too close to your target entry price using the lot size calculation feature, you can execute it in two steps with [B2]direct market entry ticket:
Example
Send a direct market ticket when OP and SL distnace too closeSend a buy order with the M5 time frame for EURUSD, with a stop-loss at 1.28582 when the stop-loss is too close to open price.
- Send a One-Bar Pending Order with the time frame you are trading, setting the open price at 1.28582.
- The utility will set the open price at 1.28582 and the stop-loss at the floor of 1.28582, which is 1.28580. It will also set the stop-loss code to the time frame code of 0.00002, where the last decimal represents the time frame you are currently trading.
- Convert this pending order into a [B2] direct market entry ticket by adjusting the Time Frame Code from 0.00002 to 0.00000
- The utility will send a market order for you at the current Bid price, with the lot size calculated based on the amount of money you are willing to risk.
For lot size calculation, you can send any arbitrary fake ticket placed far from the current market price with your desire stop-loss distance.
When Market Price and Open Price Are Too Close
This method solves the problem of the stop-loss being too close to the close price. However, you may not be able to send a pending order if your open price is also too close to the current market price. In this case, you may need to first send a market order manually with the properly calculated lot size. After the ticket is converted to a market order, send the close-price stop-loss with the appropriate timeframe code.
If you want to set the entry price more precisely, you can adjust the open price after sending the [A] One Bar pending order. Since the time frame is only determined by the open price initially, adjusting the open price of the [A] One Bar pending order will not affect the time frame code of the ticket.