How do you make this type of EA?
-
There’s an EA that starts off by placing a “buy stop order” with a stop loss of 2.5 pips. Both the stop loss and “buy stop” pending order moves downward by step of 0.2 pips when the threshold of 1.4 pips is surpassed by bid line. When a buy order is initiated, the EA trails the stop loss by step of 0.2 in an upwards direction.
How do you replicate this function?
-
Those distances are extremely short. No broker will allow doing that on their terminal. You will definitely need to use higher distances.
-
@l-andorrà so if i want it for x10 higher distances with step options added to both types of orders, how would it look like?
-
Do you have any initial project to begin with?
-
@l-andorrà https://fxdreema.com/shared/K5QGbDt9c
this is the most i can do.
The point is to trail a Buy stop order with 25 pending SL (ASK FOR BUY, BID FOR SELL) at a 24 distance with step of 2 and trail the 25 SL with step of 2.
-
The trailing stop block needs to be separated from all other block trees. You should disconnect it from its current position and connect it below a 'pass' block on a separate block tree. On the other hand, the trailing order block is not necessary unless the trade is in loss, right?
-
@l-andorrà Here’s a simple picture,
If no trade/order, buy stop should be placed 10 pips above ask price with a SL of 18 pips.
If bid price moves past adjustable distance of 18 pips below buystop, both the buystop and SL should move a step of 8 pips and so on.
If ask price moves past an adjustable distance of 8 pips above the activated buy stop order, the SL should move 8 pips up and so on.
The EA should be be buy stop only with spread filter, adjustable steps for Trailing Buy Stop Orders, adjustable steps for SL, Risk % MM, and Fixed Lot Option.
-
@l-andorrà As explained above, the EA should move just like this one but with a step of 8 adjustable pips for both trailing stop loss and the trailing buy stop pending order, see how it functions on the chart on MN timeframe besides looking at the profitability.
-
Ok. But can there be more than 1 open trade at a time? I mean what happens if the buy trade is triggered? Will there be more pending orders later?
-
@l-andorrà there will only be one at a time and only one whenever there’s no trade/order
-
@NamiyrD Then you need to use variables like this:
https://fxdreema.com/shared/uQTPeZIFd
Are you familiar with using variables?
-
@l-andorrà no I haven't used variables before to make an ea.
-
@l-andorrà I've copied the example, what should i do next? and how do i use variables next time?
-
Well, is it working as you need?
-
@l-andorrà looks like it thanks
-
You're welcome.