SetDollarTrailing evaluation on daily bars

Questions about MultiCharts and user contributed studies.
TraderWalrus
Posts: 63
Joined: 13 Sep 2016

SetDollarTrailing evaluation on daily bars

Postby TraderWalrus » 19 Feb 2017

My strategy uses SetDollarTrailing with amount calculated daily according to a multiple of AvgTrueRange.

Relevant sections below.

Code: Select all

inputs:
TrailingATR_LB(40),
TrailingATR_Multiple(2);

variables:
trailingSize(0), atrSize(0);

atrSize = AvgTrueRange(TrailingATR_LB);
trailingSize = atrSize * TrailingATR_Multiple;

setstopcontract;
setdollartrailing(trailingSize);
I found out that instead of being activated when the current profit is less than the maximum profit by trailingSize, it is done when the profit is less than the maximum profit achieved at that specific day.

Meaning, the trailing stop is only activated when the price moves sharply back on a specific day. If the move to the other direction of the position is done gradually, day by day, the trailing will never be activated.

If the trailing is constant rather then being calculated, it works correctly.

I noticed it in backtest mode, in a short position in a stock.

Will appreciate feedback and suggestions.

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016

Re: SetDollarTrailing evaluation on daily bars

Postby Angelina MultiСharts » 21 Feb 2017

Hello TraderWalrus,

Please send your workspace, export of the signal, and export of instruments used (with data) from QuoteManager to support@multicharts.com so we could replicate and study this behavior on our end.


Return to “MultiCharts”