Trailing Stop Strategies  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Trailing Stop Strategies

Postby orad » 29 Dec 2014

I'm trying to understand how trailing stops work in MC.NET. I see there are some signals related to trailing stops such as Dollar_Trailing, Percent_Trailing that generate the relevant trailing stop order on every CalcBar(). How is this supposed to work? Does that mean that when I apply this strategy to a chart then it is going to generate a new order on every calculation of the bar? That would be weird. Or is it intended to be combined with other strategies? If so, should the other strategies call those signals from their script? In that case how is a signal called from another signal? Please explain this I'm really confused. Thanks!

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Trailing Stop Strategies  [SOLVED]

Postby JoshM » 29 Dec 2014

I'm trying to understand how trailing stops work in MC.NET. I see there are some signals related to trailing stops such as Dollar_Trailing, Percent_Trailing that generate the relevant trailing stop order on every CalcBar(). How is this supposed to work?
The `Dollar_Trailing` signal uses the `GenerateDollarTrailing()` method for that:

Code: Select all

protected override void CalcBar(){
CurSpecOrdersMode = IsPositionBasis ? ESpecOrdersMode.PerPosition : ESpecOrdersMode.PerContract;
GenerateDollarTrailing(Amount);
}
That method is explained here: Special orders in MC .NET.
Does that mean that when I apply this strategy to a chart then it is going to generate a new order on every calculation of the bar? That would be weird.
No, it generates one stop-loss order that is adjusted when needed.
Or is it intended to be combined with other strategies?
Yes, `Dollar_Trailing` has no entry nor exit logic, so it's a "building block signal" instead of a complete strategy.

Of course, you can also call `GenerateDollarTrailing()` in your own signal. In that case, the `Dollar_Trailing` signal is not needed anymore.
If so, should the other strategies call those signals from their script? In that case how is a signal called from another signal?
That is not needed. You can add multiple signals to the same chart and they are combined into one strategy.

So adding the following signals:
* Bollinger_Bands_LE
* Bollinger_Bands_SE
* Dollar_Trailing

Creates one strategy that goes long or short based on the Bollinger Bands and that has a dollar trailing stop.

User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Re: Trailing Stop Strategies

Postby orad » 29 Dec 2014

Thank you JoshM for the detailed response. I also found out that we can use "Study Templates" to group together different strategy building blocks and apply them as a group on the chart. We can also export them to file, for example to check-in to source control. Now with these concepts, many of those existing study examples make more sense.


Return to “MultiCharts .NET”