Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, AndrewAMD, TipmyPip, Quad), 889 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
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 | chip programmers | 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