TrailSlope parameter unresponsive?

Posted By: GHRouge

TrailSlope parameter unresponsive? - 07/23/16 03:05

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.

Code:
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:

Quote:
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.



Description: Chart output for Trailslope=50
Attached picture TrailSlope50_EURUSD.png

Description: Chart output for TrailSlope=200
Attached picture TrailSlope200_EURUSD.png

Description: Script for TrailSlope50
Attached File
TrailSlope50.c  (5 downloads)

Description: Script for TrailSlope200
Attached File
TrailSlope200.c  (3 downloads)
Posted By: jcl

Re: TrailSlope parameter unresponsive? - 07/25/16 08:13

A trail slope of 200% produces with your script certainly a different result than 50%, because trades are closed earlier. If you don't get different results, you maybe edited the wrong file or forgot to save, or something like that.
© 2024 lite-C Forums