Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (VoroneTZ, AndrewAMD), 833 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Actual PIP Cost for backtesting #474178
09/26/18 21:34
09/26/18 21:34
Joined: Sep 2018
Posts: 29
K
kerplunk1899 Offline OP
Newbie
kerplunk1899  Offline OP
Newbie
K

Joined: Sep 2018
Posts: 29
Hi to all the community,

I have a question about the variable PIPCost and values it should assume during the backtests.
Quoting the manual:

"This value should normally remain constant during the simulation for not adding artifacts to the strategy performance figures; but if desired for special purposes, it can be calculated by script to fluctuate with the exchange rate"

Can you explain me why?
Can you please also write me the right formula I should apply to this indicator in order to simulate the actual PIPCost value on each run?

Thank you so much and regards,
Luca

Re: Actual PIP Cost for backtesting [Re: kerplunk1899] #474251
10/02/18 07:54
10/02/18 07:54
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Fluctuations are caused when your account currency is different to the counter currency. The exchange rate then determines the pipcost. It is normally not recommended to have variable pipcost in a strategy test, but if you still want it, a function for this is in the manual under "PIPCost".

Re: Actual PIP Cost for backtesting [Re: jcl] #474253
10/02/18 10:00
10/02/18 10:00
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline
Member
tradingest  Offline
Member

Joined: Feb 2018
Posts: 236
Italy
Originally Posted By: jcl
It is normally not recommended to have variable pipcost in a strategy test, but if you still want it, a function for this is in the manual under "PIPCost".


Why is not reccomended?

For a backtest from 2010 to 2018 on EURUSD for example the pipCost change too much in the perdio considered.
With PipCost equal within backtest period is not right. Are you agree with me?

Re: Actual PIP Cost for backtesting [Re: tradingest] #474254
10/02/18 10:09
10/02/18 10:09
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
No. You normally do a backtest not for measuring the effect of the EUR/USD rate on your account, but for measuring the expected future performance of a strategy.

Of course, if you for some reason don't want to know the strategy performance, but your account growth in the past, adapting pipcost can make sense. In that case you must also adapt spread, rollover, and margin cost to their historical values.

Re: Actual PIP Cost for backtesting [Re: jcl] #474259
10/02/18 11:57
10/02/18 11:57
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline
Member
tradingest  Offline
Member

Joined: Feb 2018
Posts: 236
Italy
Originally Posted By: jcl
No. You normally do a backtest not for measuring the effect of the EUR/USD rate on your account, but for measuring the expected future performance of a strategy.

Of course, if you for some reason don't want to know the strategy performance, but your account growth in the past, adapting pipcost can make sense. In that case you must also adapt spread, rollover, and margin cost to their historical values.


What if my strategy uses the Tradeprofit function? This one is based on amount and not pips. In this case it would make sense to have a real pipCost. Right?

Does it exist any function like TradeProfit that works with pips?

Thanks

Re: Actual PIP Cost for backtesting [Re: tradingest] #474263
10/02/18 14:23
10/02/18 14:23
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Tradepips = TradeProfit/TradeUnits/PIP.

http://manual.zorro-project.com/trade.htm

Re: Actual PIP Cost for backtesting [Re: jcl] #474265
10/02/18 20:10
10/02/18 20:10
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline
Member
tradingest  Offline
Member

Joined: Feb 2018
Posts: 236
Italy
Thanks jcl the thread is more interesting.
For example, the code below the annual profit on EURUSD asset is 1.6% +290.4p. What is the performance referred to by not having an initial capital?
+290.4 What are they related to? What do they indicate?
Code:
// Trend Trading ///////////////////
#include <profile.c>

function run()
{
	vars Price = series(price());
	vars Trend = series(LowPass(Price,500));
	
	Stop = 4*ATR(100);
	
	vars MMI_Raw = series(MMI(Price,300));
	vars MMI_Smooth = series(LowPass(MMI_Raw,500));
	
	if(falling(MMI_Smooth)) {
		if(valley(Trend))
			enterLong();
		else if(peak(Trend))
			enterShort();
	}
	
	StartDate = 2010;
	EndDate = 2018; // fixed simulation period 2009-2014
	
	set(LOGFILE); // log all trades
	PlotWidth = 800;
	PlotHeight1 = 300;
	ColorUp = ColorDn = ColorWin = ColorLoss = 0;
	ColorDD = BLACK;
	ColorEquity = GREY;
	//plot("MMI_Raw",MMI_Raw,NEW,GREY);
	//plot("MMI_Smooth",MMI_Smooth,0,BLACK);
	//plotTradeProfile(-50); 
}


Re: Actual PIP Cost for backtesting [Re: tradingest] #474302
10/05/18 02:39
10/05/18 02:39
Joined: Dec 2016
Posts: 71
F
firecrest Offline
Junior Member
firecrest  Offline
Junior Member
F

Joined: Dec 2016
Posts: 71
Hit should be $290 earn

Re: Actual PIP Cost for backtesting [Re: firecrest] #474303
10/05/18 05:43
10/05/18 05:43
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline
Member
tradingest  Offline
Member

Joined: Feb 2018
Posts: 236
Italy
Originally Posted By: firecrest
Hit should be $290 earn


but without to set capital the % is related to?

Re: Actual PIP Cost for backtesting [Re: tradingest] #474314
10/05/18 14:53
10/05/18 14:53
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
The percentage is the ratio of profit to margin and drawdown. Look in the manual under Performance, all the numbers are explained there.

Page 1 of 2 1 2

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