Trailing Stop

Questions about MultiCharts .NET and user contributed studies.
eunos64
Posts: 44
Joined: Sep 15 2013
Has thanked: 15 times
Been thanked: 4 times

Jun 06 2024

Hello,

I found a topic of Trailing in MultiChart's Blog about MultiCharts .NET 15.0 Release.
The topic stated as following....

"
Scripts/Calculations
- Trailing is now executed identically during backtesting and auto trading
"

I was using the MC.NET14 built-in PctTrailingStop and when I was holding a position that was unrealized profit, if I crossed a weekend or restarted my PC, it would close at an unintended price that was lower than expected.
I was trying to create a new strategy to resolve this, and if this has been resolved I will try the new version.

So, please explain on this point a bit further showing some examples.

Best regards,

eunos64
Posts: 44
Joined: Sep 15 2013
Has thanked: 15 times
Been thanked: 4 times

Jun 07 2024

For example, suppose you have a buy position with unrealized profit, the price is above the PctTrailingAmt setting, and a TrailingStop order is triggered.
Suppose you restart Windows in this state.
The TrailingStop order is cancelled.
You start MC and turn on AT mode for the strategy for which this position is the target. The strategy will then set the entry price and display it on the chart as InitialEntry. In this case, the price is set correctly, but the entry point is not shown retrospectively, but is set to the Bar where you turned on AT mode, i.e., the latest CurrentBar.
In this situation, if you are still in an unrealized profit, the strategy will recalculate from the InitialEntry price and the current price and place a TrailingStop order.

However, if the price fluctuates during the restart and the high price is significantly higher, the strategy will not consider this higher price and will calculate the price of the TrailingStop order based solely on the InitialEntry price and the current price.

Is this understanding correct? Is it wrong? Is my setup incorrect?

Translated with DeepL.com (free version)

eunos64
Posts: 44
Joined: Sep 15 2013
Has thanked: 15 times
Been thanked: 4 times

Jun 27 2024

The reason I asked this question is because I imagine there are many people who use trailing stop orders and therefore will be affected much.
In fact, I use them and think that this change will affect my strategy.

eunos64
Posts: 44
Joined: Sep 15 2013
Has thanked: 15 times
Been thanked: 4 times

Jul 23 2024

I found the following topic and leave it as a note for myself.

viewtopic.php?p=131421&hilit=maxcontractprofit#p131421

However, the following questions remain unanswered I would like to know how the change was made.
I found a topic of Trailing in MultiChart's Blog about MultiCharts .NET 15.0 Release.
The topic stated as following....

"
Scripts/Calculations
- Trailing is now executed identically during backtesting and auto trading
"

I was using the MC.NET14 built-in PctTrailingStop and when I was holding a position that was unrealized profit, if I crossed a weekend or restarted my PC, it would close at an unintended price that was lower than expected.
I was trying to create a new strategy to resolve this, and if this has been resolved I will try the new version.

So, please explain on this point a bit further showing some examples.
How is the Trailing calculation algorithm handled internally?
If it is processed using MaxContractProfit, I would naturally assume that if I restart the PC or the application, the Trailing calculation results would be the one I have indicated, am I wrong?

User avatar
Polly MultiCharts
Posts: 264
Joined: Jul 20 2022
Has thanked: 1 time
Been thanked: 67 times

Aug 01 2024

Hello eunos64,

Starting from MultiCharts 15 these orders: SetDollarTrailing (Amount) SetPercentTrailing(Profit,Percentage) SetBreakEven(Profit) work a bit differently.
When the Amount (Profit) parameter is changed, the order starts tracking its state again, as if it was canceled and placed again.
Previously, this behavior was only in backtesting but now it works in backtesting and live trading.
For more detailed info please see this page.

eunos64
Posts: 44
Joined: Sep 15 2013
Has thanked: 15 times
Been thanked: 4 times

Sep 02 2024

I think, This is a small but very very big progress !! :D
This change should be emphasized more and made known to customers.
I have confirmed with MC ver. 15 release3.

Thank you Polly , Thank you MC team !!! :D :D :D

Image
スクリーンショット 2024-08-08 2112473.jpg
(308.03 KiB) Not downloaded yet
This screenshot was taken with older MC ver.14.
Both charts have same strategy, the left chart was running Automation in 'SA' mode.
This signal has a %TrailingStop that changes the value of the trailing stop conditional on the value of the moving average.
In Ver.14, when the value of %TrailingStop changed depending on the condition, the order was executed when the condition changed, as shown in the chart on the left.

In MC15, I saw that the same signals were executed as in the chart on the right, i.e., as in the backtest results.
Polly is probably referring to this.