How to make buy stop, sell stop script
-
Hello,
How above, how to make script buy stop and sell stop (10 pips from current price) and take profit with 25 pips?
I want this script to NFP news.Thank you for your responds.
-
Note that "Script" is different that "Expert Advisor". Both are similar, but something is very different - Scripts work once. I'm not sure that you are asking for a Script.
But anyway. I think it's enough to make 2 pending orders. You can find the blocks for that. Note that in these blocks (let's say "Buy pending order") you don't have an option to define the type of the order. The type is automatically decided by the open price. What you need to define is the price at which the order will be opened. By default for Buy order that price is Ask + 20 pips. You can see that Ask is selected and there is 20 in "Price offset". If you change 20 to -20 you will see that the order will be created on the opposite side.
And you have SL and TP options, so you can set that TP of 25 pips.
There is something more interesting. You can use 2 blocks, one for Buy and one for Sell and that's ok. But if you want to close the Sell order when the Buy order is triggered (or to close the Buy when the Sell is triggered), then you can create only one block (let's say Buy pending order) and enable the OCO option. Now this block will create 1 Buy and 1 Sell order, and when one of them is triggered, the other will be deleted automatically.