Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,175 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
TrailSlope parameter unresponsive? #461034
07/23/16 03:05
07/23/16 03:05
Joined: Jul 2016
Posts: 4
G
GHRouge Offline OP
Guest
GHRouge  Offline OP
Guest
G

Joined: Jul 2016
Posts: 4
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.

Attached Files
TrailSlope50_EURUSD.png (12 downloads)
Chart output for Trailslope=50
TrailSlope200_EURUSD.png (8 downloads)
Chart output for TrailSlope=200
TrailSlope50.c (5 downloads)
Script for TrailSlope50
TrailSlope200.c (3 downloads)
Script for TrailSlope200
Re: TrailSlope parameter unresponsive? [Re: GHRouge] #461090
07/25/16 08:13
07/25/16 08:13
Joined: Jul 2000
Posts: 28,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
Frankfurt
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.


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1