forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Forum

Forex Software, Forex Strategies, Expert Advisors Generator

You are not logged in. Please login or register.


Forex Forum → Help and Support → Trailing Stop - Why no Trailing Step parameter?

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 20

Topic: Trailing Stop - Why no Trailing Step parameter?

Hi there

I my be misunderstanding something(s) and can't find Forum or Wiki info on this.

I'm familiar with a Trailing Stop (usually) having two parameters: the Initial Stop and the (useful) Trailing Step.

But I don't see Trailing Step in the FSB 'Trailing Stop' and 'Trailing Stop Limit' options for the 'Closing Point' slot.
- They only have a 'Trailing Stop' or 'Initial Stop Loss' parameter (respectively).

So e.g.if I set this at 1000 (=100 pips in a 5 decimal instrument) then only when the position is 1000 in profit will the Stop begin trailing - and presumably with a 'default' Trailing Step of 1 (or maybe a default Trailing Step of 1000?).

Any assistance clarifying this 'Trailing Step' parameter question would be much appreciated.

Re: Trailing Stop - Why no Trailing Step parameter?

We have Trailing Step parameter equal to 10 points. This parameter is coded in the Expert Advisors and it is used only in "New tick" mode.

The Trailing Stop has two Trailing modes: "New bar" and "New tick".

For backtesting FSB uses only "New bar" mode. It moves the trailing stop only at a new bar if there is a new High (Low for short positions). If the initial stop is XX points, FSB starts trailing when the market forms new highest High (or low for shorts). It puts the SL XX points below the highest High.

You can uses "New bar" or "New tick" for trading via the Trader (MT bridge) or with Expert Advisors. The "New bar" works in the same way as in the backtesting mode. If you use "tick mode", the EA moves the stop when there is a new High using a Trailing Step parameter.

You can find this parameter in the beginning of the Expert Advisers.

This is copy of the EA code with more info:

// TrailingStop_Moving_Step determines the step of changing the Trailing Stop.
// 0 <= TrailingStop_Moving_Step <= 2000
// If TrailingStop_Moving_Step = 0, the Trailing Stop trails at every new extreme price in the position's direction.
// If TrailingStop_Moving_Step > 0, the Trailing Stop moves at steps equal to the number of pips chosen.
// This prevents sending multiple order modifications.
int TrailingStop_Moving_Step = 10;

Re: Trailing Stop - Why no Trailing Step parameter?

Hi Popov

Thank you for your usual quick and clear reply.

So, as I hopefully correctly understood: for backtesting, the 'Initial Stop' is used as the 'Trailing Step' in the FSB 'Trailing Stop' and 'Trailing Stop Limit' options for the 'Closing Point' slot.

This will result in very large 'Trailing Steps' if a large 'Initial Stop is set - which, if I understand, isn't the usually required behaviour of a Trailing Stop.

As you explained the current options:
- One cannot backtest different 'Trailing Step' parameters: Trailing Step = Initial Stop.
- And (of course) one cannot backtest manual edits to the 'Trailing Step' in the code.

Question please, for my understanding:
Do you agree that it could be helpful to have a 'Trailing Step' parameter in the FSB 'Trailing Stop' and 'Trailing Stop Limit' options for the 'Closing Point' slot - available for backtesting (if technically possible?)

I do of course understand you have a long list of more pressing and important issues.

Thanks again for all your help.

Re: Trailing Stop - Why no Trailing Step parameter?

There is no trailing step in the backtester. Or, if you prefer, the Trailing Step = 1 point.

Re: Trailing Stop - Why no Trailing Step parameter?

Got it. Thanks again, Popov.

6 (edited by vidagig_13 2016-05-11 21:35:57)

Re: Trailing Stop - Why no Trailing Step parameter?

Hi again Popov

After more thought there may be some confusion over how a Trailing Stop usually functions.
I did research before posting this subject to confirm my understanding of how the Trailing Stop offered by some brokers usually functions - and it's clearly explained here:

http://help.saxobank.com/customer/portal/articles/1945781-what-is-a-trailing-stop-order-and-how-can-i-use-it-

This describes a Trailing Stop with
1) An Initial Stop - self explanatory.
2) A Trailing Step - defines the number of points profit after which the Initial Stop will be trailed by the specified Trailing Step.
NB: The position is not required to be in profit by the amount of the Initial Stop before the Trailing Stop commences.

If I reread your explanation (above) of the Trailing Stop functionality in FSB backtesting (using 'new bar mode') it does not conform to this functionality. If I understand you, in FSB the Trailing Stop only commences trailing in 1 point increments when the position is in profit by the amount of the Initial Stop.
- This is a very different functionality: As I said previously, this results in a profit equal to the Initial Stop being required before the position begins trailing (and in fixed 1 point increments).

Your description of the functionality when using 'new tick mode' (not available for backtesting) isn't detailed and exactly clear to me, but it does appear to conform to the expected functionality described as clearly as I can, above - and has different functionality to that you describe for 'new bar' mode.
But, one can't backtest in FSB using the "TrailingStop_Moving_Step" setting available only in the source code - only for trading in 'new tick mode'.

So, the Trailing Stop functionality (and behaviour) available for backtesting in FSB appears to be a different and maybe not as useful interpretation of how a Trailing Stop usually functions.

Perhaps you can confirm if my understanding is correct that the Trailing Stop available for backtesting in FSB does function differently to the (standard from what I've seen) Trailing Stop functionality provided by some brokers.


Much appreciated

Re: Trailing Stop - Why no Trailing Step parameter?

FSB appears to be a 'very different interpretation' of how a Trailing Stop usually functions.

FSB Trailing Stop works in a guaranteed safe way.

What does it mean "usually"?

If you think the MT "tick mode" trailing is correct, better check again. Do you think that MT "really" has tick mode testing? The last time I checked the MT "ticks" was noting more than a crappy function: https://www.mql5.com/en/articles/75

Perhaps you can confirm if my understanding is correct that the Trailing Stop available for backtesting in FSB does function differently to the (standard from what I've seen) Trailing Stop functionality provided by some brokers.

We have that function in FSB from 10 years and there is no problems reported so far. Our Trailing Stop works in the exactly same way in the Expert Adviser trading as in the FSB backtest. I think this is the only correct way. We cannot provide "tick" trailing of the Trailing Stop in the backtest because we do not have tick information in our historical data. MT and another "usual" brokers also do not have it. However, they provide tick testing "usually" smile like that:

https://c.mql5.com/2/1/ideal_white_MQL5.png

The purpose of FSB is not to function like the other brokers but to provide a safe backtest. How many brokers do you see to speak about FSB? And do ask yourself why all of them pay $ 100 k  for MT? Yes, yes, you are correct. Not the brokers pay but the traders.

I'll tray to explain again how the Trailing Stop works in the FSB backtest and in the exported EAs.

Lets we have Trailing Stop 20 points "New Bar" mode.

http://s32.postimg.org/qacjjygap/screenshot_1597.jpg

When we open a long position, the program sets SL 20 points below the order price. If the market goes down and hits our SL, the loss will be the current spread + 20 points.

If the position is not closed during the opening bar, FSB checks the High of the previous bar. If the High is lower than the position opening price + 20 points, the SL remains at the same level. If the previous bar High is higher than the positions opening price + 20 points, the program sets the SL to High - 20 points.

FSB moves the Trailing Stop only at a new bar because the previous High is the only secure value it can use for reference on backtest. The Trailing Stop will trail once at every new High when trading with an exported Expert Advisor. This grantees compatibility between the tests and the trade.

You can set "new tick" mode for the Trailing Stop, but it doesn't change the way FSB tests the strategy. The "tick mode" makes the Trailing Stop trailing like the "usual" platforms. The trailing step is 10 points by default, but you can change it in the EA code. We cannot guarantee that if you backtest such strategy again with newer data, you will receive the same result. Metaqutoes doesn't guarantee also, but it doesn't care for that. Their users are happy enough to use "tick" testing without questions.

8 (edited by vidagig_13 2016-05-12 11:05:43)

Re: Trailing Stop - Why no Trailing Step parameter?

Hi Popov

Please calm down I think there may be too much heated debate on here, as a general observation.
I'm reminded now of how easy it is to fail to communicate clearly, or, to misunderstand a written communication and be mistakenly upset by it.

I think you misunderstood and missed the 1 key point of my previous post - I was not making issue with the use of bar data vs. tick at all, or broker or MT4 issues (I wasn't going there at all).- I just felt I should refer to your explanation and terminology re the difference in FSB's Trailing Stop re. tick and new bar.

My apologies for not succeeding in communicating more clearly the one problem I am confused about.

My question is only about the behaviour of the way the FSB Trailing Stop 'rules' work vs. they way I've seen it usually set up at brokers.

Again I repeat my understanding: You say the FSB Trailing Stop waits for the position to be in profit by the amount of the Initial Stop before it starts trailing in Trailing Steps equal to the Initial Stop. I hope I understand this clearly.

I point out that the Trailing Stop I am familiar with - as per the link example, has a different functionality and behaviour.
This Trailing Stop has a (user input) Trailing Step parameter (FSB doesn't) , and it starts trailing the initial Stop as soon as this Trailing Step is reached in profit; and trails in increments of the Trailing Step NOT increments of the Initial Stop.
NB: I.e. It does not wait to be in profit by the amount of the Initial Stop before it starts trailing - and in increments of the Initial Stop. This is the key difference I'm asking about.

In FSB (backtesting) it trails in increments of the specified Initial Stop, not in increments of the Trailing Step - as you describe the FSB Trailing Stop behaviour.
So, if I understand, you're saying in effect that in FSB, the Initial Stop and the Trailing Step are identical.
This is the key point of difference in functionality and resulting (undesirable) behaviour I'm trying (very hard) to describe.


Here's an example which may help:

I want a Trailing Stop in FSB with an Initial Stop of 1000 (=100 pips in 5 decimal instrument)
So FSB will only start trailing when I'm in profit by a massive 100 pips - and in increments (Trailing Steps) of a huge 100 pips.
The usual Trailing Stop would allow me to specify the Trailing Step and it will start trailing as soon as the position is in profit by the Trailing Step (e.g. only 10 pips) NOT when it is in profit by the amount of the Initial Stop (e.g. 100 pips).

So in a 'usual' Trailing Stop setup screen - I can set the Trailing Step at 100 (or i.e. 10 pips). When the position is in profit by only 10 pips it will start trailing in only 10 pip increments.
In FSB it would wait for profit of 100 pips before trailing in increments (Trailing Steps) of 100 pips.
Surely this is a big difference in behaviour, again, if I understand you correctly.

I may be misunderstanding your explanation and your are indeed describing the behaviour I expected, but having used the Trailing Stop a lot in FSB backtesting - using a big Stop of e.g. 100 pips (1000 in FSB) and a small Take Profit e.g. 10 pips (100 in FSB) - I see that it never actually trails, and now I think I understand why.

This is a big difference in behaviour in my understanding, hence the question and concern.

Thanks for your help and patience.

Re: Trailing Stop - Why no Trailing Step parameter?

Hmm. I checked the formulas now and I see it is not necessary the position to be on a profit. The Trailing Stop trails every time when there is a new highest High of the previous bar.

http://s32.postimg.org/gyfwklsjl/screenshot_1600.jpg

10 (edited by vidagig_13 2016-05-12 11:43:57)

Re: Trailing Stop - Why no Trailing Step parameter?

Please note I'm talking about backtesting the Trailing Stop in FSB - it's available settings and behaviour in the FSB backtester - not it's (apparently correct) MT4 behaviour.

One needs to be able to backtest in FSB the same behaviour as happens in MT4.

In the FSB backtester (you say) it trails in increments of the Initial Stop(?) - not in a user specified Trailing Step - that can be much smaller.
Also, again, the user setting of Trailing Step is not available in FSB backtester

This is the big difference in available settings (Trailing Step missing) and resulting behaviour when you compare the FSB backtester Trailing Stop and a the correct Trailing Stop - that I have tried to explain in detail repeatedly in my previous posts.

Quote 1: "For backtesting FSB uses only "New bar" mode. It moves the trailing stop only at a new bar if there is a new High (Low for short positions). If the initial stop is XX points, FSB starts trailing when the positions makes XX points profit and the program puts the stop at XX points below the current close price."

Quote 2: " If the High is lower than the position opening price + 20 points, the SL remains at the same level. If the previous bar High is higher than the positions opening price + 20 points,  the program sets the SL to High - 20 points."

Re: Trailing Stop - Why no Trailing Step parameter?

As I said, it was my mistake. It is not necessary to make profit in order the Trailing Stop to trail.

FSB tests and trades at the exactly same way. Deviations are possible in rare cases. In such cases FSB shows ambiguous bars. It also provides various interpolation methods and covers all known cases.

Since you give link to SaxoTrader and want similar (usual) behavior, can you explain how SaxoTrader backtests trailing stops? Are you sure you want this method in FSB?

12 (edited by vidagig_13 2016-05-12 11:55:50)

Re: Trailing Stop - Why no Trailing Step parameter?

Here I'm trying to show the Trailing Stop doesn't appear to function in FSB backtester. The position never trails - with an Initial Stop of only 200 and a Take Profit of 5000.

I may be doing something wrong?

Pic 1 of setup screen attached - pic 2 of the Trade journal to follow

Post's attachments

160512 FSB EA backtest with Trailing Stop - setup screen.JPG 153.82 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

13 (edited by vidagig_13 2016-05-12 11:58:11)

Re: Trailing Stop - Why no Trailing Step parameter?

pic 2 of the Trade journal

Post's attachments

160512 FSB EA backtest with Trailing Stop - Trades Journal.JPG 308.58 kb, 2 downloads since 2016-05-12 

You don't have the permssions to download the attachments of this post.

Re: Trailing Stop - Why no Trailing Step parameter?

I see different values of the ProfitLoss: -220, -115, -119, -168, -84 ...

Since the only exit rule that may close at a loss is Trailing Stop, it is obviously that the Trailing Stop trails.
If the Trailing Stop was constant, it would show equal losses.

Re: Trailing Stop - Why no Trailing Step parameter?

Apart from the example of Traling Stop apparently not trailing in FSB backtester.

Again I repeat my concern:

A) the user setting of Trailing Step (not available in FSB backtester) AND
B) the Trailing Stop trailing using the Trailing Step and NOT the Initial Stop - is the way that a Trailing Stop always functions at any broker that offers a Trailing Stop.

(In my experience..)

16 (edited by vidagig_13 2016-05-12 12:20:55)

Re: Trailing Stop - Why no Trailing Step parameter?

Ok I see now the different profits and losses - thank you. - So it is trailing.

(I expected to see the Stop changes as entries in the Journal but now I see it looks like the Trailing Stop movements are visible in the 'Bar Explorer' view. Ahaa moment)

Last question I hope, please - to be absolutely clear:
Is it trailing in increments of the Initial Stop or default increments of 1 pip (10 in FSB)?

(From the irregular profit losses I presume it is trailing in increments of 1 pip?)

Re: Trailing Stop - Why no Trailing Step parameter?

B) the Trailing Stop trailing using the Trailing Step and NOT the Initial Stop - is the way that a Trailing Stop always functions at any broker that offers a Trailing Stop.

If you refer SaxoTrader and you are familiar with it, you will probably know that they doesn't provide backtesting.

If you refer MT, they doesn't provide Trailing Stop for use in Expert Advisors. They have manual Trailing Stop that doesn't have trailing step.

On the other hand, Forex Strategy Builder provides an unified way for backtesting and trading with equal rules.

18 (edited by vidagig_13 2016-05-12 12:40:35)

Re: Trailing Stop - Why no Trailing Step parameter?

Thanks again Popov for your apparently endless patience.

Just confirming my understanding:

The Trailing Stop in FSB backtester is trailing in 'Trailing Step' increments of 1 point.

As you said: "There is no trailing step in the backtester. Or, if you prefer, the Trailing Step = 1 point."


[I just used the Saxo explanation link that I found - because it described exactly the identical Trailing Stop behaviour and the availability of the Trailing Step user setting I have seen/used at other brokers]

Re: Trailing Stop - Why no Trailing Step parameter?

There is no such thing as Trailing Step in the backteser. FSB calculates the Trailing Stop as a difference between the previous High and the value in points you set.

                if (wayPointOrder < wayPointHigh && stop < DataSet.High[bar - 1] - deltaStop)
                    stop = DataSet.High[bar - 1] - deltaStop;


Where deltaStop is a value in points.

Thanks again Popov for your apparently endless patience.

2/3 of my time I answer to emails like:

What is the main difference between your product and Strategy Quant Pro apart from the fact your product is much cheaper. Does cheaper mean not so good?

Please explain me ....
I need this information to decide if buy the software.


How ...
Can you send me the step by step?

...

These are from this morning only

Re: Trailing Stop - Why no Trailing Step parameter?

Or.. as my mother's teacher used to say: "G-d give me the strength to teach these morons."

You clearly very effectively manage the '4 Quadrants of time management'.
- one of "The 7 Habits of Highly Effective People" - by Stephen Covey*

- You have provided a great program and support for a very long time now and it's greatly appreciated by many.

Thanks again.

Cheers.

*Quadrants summary: http://www.brefigroup.co.uk/acrobat/quadrnts.pdf

Post's attachments

The 7 Habits of Highly Effective People - Balancing the 4 Quadrants.jpg 48.48 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Posts: 20

Pages 1

You must login or register to post a reply

Forex Forum → Help and Support → Trailing Stop - Why no Trailing Step parameter?

Similar topics in this forum