Stop Loss on Buy Stop Order
-
When I run a test my initial Buy Stop shows the correct buy stop (0.98256), stop loss (0.97560) and take profit (1.00959) price but when the trade actually opens it says that the stop loss requested is too short (it is using the buy stop opening price (0.98256) as the stop loss not the originally calculated stop loss) and it will use a minimum stop loss that appears to be equal to the spread. This means I am stopped at at the time of opening the trade.
I tried to attach a screenshot from the journal in strategy tester (but get an error) that shows the first line (bottom line) with a stop loss of 0.97560. The calculation for this works correctly. The 2 lines above that it says "Warning: Too short SL requested (0.98256 or 0 points), minimum will be taken (0.98230 or 26 points)".
How do I fix this please?
-
Pending orders turn into running trades on the server. This message "Too short SL requested" is on the EA side, this message comes from the EA when it tries to open new trade/order or change stops. I don't believe that a pending order is opened correctly and then when that order turns into trade, such error message appears. Most probably the SL is not correct when trying to send the pending order
-
Thanks. Not sure what I'm meant to do with this though?
Is there a different way I should be placing a buy stop order? i.e. I know at what price I want to buy based on calculations using the condition and formula blocks. The price is currently below this price. How do I place an order to buy above the current price and have my stop loss value applied?
Does it make any difference that the stop loss is a variable that has been calculated from within a Formula block? If so how do I get around this? I have a formula that subtracts from the low of the previous bar a percentage of the ATR. This result is put into a Variable, say "Part3". I then use a Custom (price level) as my stop loss and use the Variable "Part3". Is there another way to do this?
-
The type of the pending orders is determined automatically, this is from the very beginning. I personally never knew what is limit and what is stop, for me pending orders are few types - buy above, buy below, sell above, sell below. So, the block will put the order at the requested price and the type will be whatever the type should be at that price - stop or limit.
SL is also very direct. If Part3 contains value of some price level that is correct (on the right side of the open price), then there is no reason for this SL level to not be applied. But error appears, then I guess that something is not calculated correctly. The chance for a bug in the block is much smaller

-
I understand that it's more likely to be an error in my code than a bug in the block. I don't understand what I need to do to code it correctly. As mentioned originally when I run a test the buy stop, stop loss and take profit are correct. It is when the order actually opens that the stop loss value changes. Are you able to have a look at my Project "RSI(2)v1.0"?
-
Ok I think the error is in my trailing stop not the original stop loss.
My trailing stop is meant to be:
opening price - stop loss x 2For example:
0.89678 - 0.89117 x 2 = 0.01122The trailing stop is trying to place a stop at 0.01122 pips from the opening price. How do I convert this into pips? I could multiply by 10,000 and get 112.2 pips but this wouldn't work for JPY pairs?
-
Here and there in blocks, including the Trailing Stop block, you will see three types of custom input:
- Custom (level) - the expected value is like 1.2345 when you mean 1.2345. Whatever value you enter, this will be the value that will be used. If you put 10 and we are talking for SL, then the stop-loss line will be put at price 10. Not 10 pips from the current price, but the actual price of 10
- Custom (pips) - you should enter value like 10 when you mean 10 pips. These 10 pips are relative to the current price
- Custom (price fraction) - you should enter value like 0.0010 when you mean 10 pips. These 10 pips are again, relative to the current price