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,
Trailing Stop
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)
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)
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.
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?
viewtopic.php?p=131421&hilit=maxcontractprofit#p131421
However, the following questions remain unanswered I would like to know how the change was made.
How is the Trailing calculation algorithm handled internally?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.
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?
- Polly MultiCharts
- Posts: 264
- Joined: Jul 20 2022
- Has thanked: 1 time
- Been thanked: 67 times
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.
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.
I think, This is a small but very very big progress !!
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 !!!
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.
![Very Happy :D](./images/smilies/icon_biggrin.gif)
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 !!!
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Image](https://www.dropbox.com/scl/fi/28iwe1dl74mrx86i2sppl/2024-08-08-2112473.jpg?rlkey=ljvko0x7udc4b41qp09percc7&st=w7ax23x6&dl=0)
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.