Dukascopy
 
 
Wiki JStore Search Login

Getting an ATR based Trailing Stop to update each day
 Post subject: Getting an ATR based Trailing Stop to update each day Post rating: 0   New post Posted: Fri 07 Jul, 2017, 11:04 
User avatar

User rating: 0
Joined: Fri 05 Aug, 2016, 18:22
Posts: 1
Location: United KingdomUnited Kingdom
Hi,

I would like some help on Visual Jforex, namely getting an ATR trailing stop to update each and every day according to the value of the previous days ATR.

I've been adapting Efegen's Poseidon System to use ATR based stops: https://www.dukascopy.com/fxcomm/fx-article-contest/?Poseidon-Tested-With-Eurusd-And&action=read&id=3221

This is based on the Turtle Trading style. Namely it places pending orders once per day to go long on a breakout of the 55 Day Donchian High or go short on a breakout of the Donchian Low. An initial Stop Loss is set along with a wider trailing stop for when the market trend carries on in our direction.

His system uses fixed pip values for the initial & trailing stops, but I've been trying to adapt it to use stops based on multipliers of the 1 day shifted ATR (20 day). I've succeeded in doing this, but there is one aspect of it I can't get to work. When we're in a trade I want the trailing stop level to change each and every day based on the previous days ATR, e.g. Trading U/J on day 1 of the trade opening the ATR(20) is 1.10 and we are using an ATR multiplier of 1.5, then the trailing stop should be set as (1.10 x 1.5=) 1.65 - using "Double" variable to be more accurate rather than "Integer". If the market moves up significantly and the shifted ATR(20) the next day is now 1.20, then at the start of the new day I want the strategy to change that days trailing stop to be set as (1.20 x 1.5=) 1.80, and so on, each day. I've been working a lot on this, testing out different ways to do it, but I can't seem to get it to work.

I am attaching two strategy files showing what I have done so far. Version 1 works out the trailing stop level based on the day the trade is entered, but then doesn't change the trailing stop level. If on day 1 of the trade the ATR is 1.10 x 1.5 (multiplier), then the trailing stop would be set as 1.65 throughout the entire period of the trade, so if the trade is open for a month, the trailing stop level never changes, stuck @ 1.65.

Version 2 is similar, but I've created a second ATR & trailing stop calculation further up on the "On Candle" starting point that triggers when there is an open trade. This version uses the ATR of the day the trailing stop is triggered rather than the day the trade is entered, e.g. on day 1 the trade is entered with an ATR of 1.10. If the market moves sideways a few day and we are still in the trade, then on day 5 the trailing stop gets triggered, this version takes the ATR from day 5 to work out the trailing stop level. However, it then just uses the day 5 trailing stop calculation for the rest of the trade.

I've never really used Visual Jforex before, so my files might be a bit messy and there might be easier ways to work out the trailing stop using "Double" than in my strat files. Please could someone take a look and help me. I've tried different ways of trying to get the trailing stop level to update each day, but I can't figure it out.


Attachments:
TF_TEST_ATR_V1.vfs [63.36 KiB]
Downloaded 151 times
TF_TEST_ATR_V2.vfs [65 KiB]
Downloaded 141 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com