I have been individually testing some of the built-in Zorro functions and have noticed that TrailSlope=50 or TrailSlope=200 in the following below implementation (if correct) does not seem to affect the outcome of where the stop is placed.
I am basing this off the identical output charts which does not show the rate of change of the stop loss to be changing. The number of pips gained during the testing period for the two values of TrailSlope tested does not vary either, so it wouldn't be a charting display issue.
function run(){
StartDate = 20070101; //
EndDate = 20070501; // small sample window to inspect trailslope
BarPeriod = 60;
Stop = 5 * ATR(3);
Trail = 1 * ATR(3);
TrailSlope = 200;
// calculate the buy/sell signal
vars Price = series(price());
vars Filtered = series(BandPass(Price,30,0.5));
vars Signal = series(FisherN(Filtered,500));
var Threshold = 1.0;
// buy and sell
if(crossUnder(Signal,-Threshold) && NumOpenLong <1 )
enterLong();
else if(crossOver(Signal,Threshold))
enterShort();
// plot signals and thresholds
set(PLOTNOW);
PlotDate = 20070401;
plot("Stop", TradeStopLimit,0,0x00B22222);
ColorEquity = 0;
ColorDD = 0;
PlotWidth = 2000;
PlotHeight1 = 1000;
}
It is simply a modification of the Workshop 5 script with changes made to produce the attached charts for easy visual inspection. The output charts and the scripts used for producing them are attached. These tests were performed on the provided EURUSD data.
I have chosen the values for TrailSlope based on the manual:
Trailing 'speed' in percent of the asset price change (default = 100%); has only an effect when Stop and Trail are set and the profit is above the trail distance. Example: The asset price of a long position goes up by 10 pips. TrailSlope = 50 would then raise the stop loss by 5 pips. TrailSlope = 200 would raise the stop loss by 20 pips.