Trailing stop

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Trailing stop

Postby loseend » Sat Jun 18, 2022 11:52 pm

Hi there,
Apprentice, I need your help. I use a framework of yours and built a trailing stop, may be you remember, I had questions about it in the past. Once I used it for GBPUSD but for a couple months now I do only GBPJPY. Actually this EA works just fine. But there is one thing that's a bit annoying to me.

I you open a trade you don't want the EA start trailing right away, better you have the EA wait until the trade has moved some pips in the trade's direction in order to not getting stopped out early.
I solved this by assigning a percent value: 'if trade is n percent in the plus start trailing'. Usually I set the percent value at 0.08% if the 9-period-ATR is <= around 10 pips. If ATR is close to 18 pips I have to adjust the percent value in advance – and so on...

I really would like to use the ATR itself instead of a percent value but it won't work. And i wonder if this is even possible I mean using the ATR?? I tried but the ATR values the EA is processing must be wrong.

I get the notion that using the ATR ist just not possible. For if a trade is opened the EA only starts reading prices right from that moment on – not before. The ATR indicator might have the same problem: the ATR value at that point in time might be comprised of only only one candle...
Am I right here? I hope not.

So my question is can you help me with this? Is it possible to make the the ATR edit correct values in that exact moment the trade is opened?
Attachments
TS.lua
(22.65 KiB) Downloaded 37 times
loseend
 
Posts: 56
Joined: Tue Jul 31, 2018 12:37 pm

Re: Trailing stop

Postby Apprentice » Mon Jun 20, 2022 11:30 am

We have added your request to the development list.
Development reference 367.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trailing stop

Postby Apprentice » Wed Feb 14, 2024 2:26 pm

I don’t see anything wrong with ATR or with the attached code.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Google [Bot] and 14 guests