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
1 registered members (degenerate_762), 1,114 guests, and 1 spider.
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
Calculating Profit #454870
09/26/15 15:52
09/26/15 15:52
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
I'm sure I missed something and it might be really simple but I can't see it.

I calculated my TradeCosts variable from the manual:
Quote:
The roundturn cost of a currency trade - without rollover and slippage - is Lots*(Commission*LotAmount/10000 + Spread*PIPCost/PIP).

and do trades in a test like:
Code:
[EUR/USD::L5901] Long 1@1.3616 Risk 1$ p at 15:00
Spread: 0.00005
Commission: 0.6000
LotAmount: 1000
PIPCost: 0.08710
TradeCosts: 0.10355
Target Distance (PIPs): 15.2
EstimatedProfit: 1.42
EstimatedRiskReward: 0.5
[EUR/USD::L5901] Target 1@1.3631: +1.09 at 15:03



I trade 1 Lot. So if I buy it at 1.3616 and sell it at 1.3631 the difference is 0.0015 that makes a raw profit of 1.5/Lot. If I deduct trade costs of 0.10355 the profit should rest at 1.40 (1.39645).
For the real profit is 1.09 only I missed something, but what? Slippage I guess would have been expressed through other buy/sell prices if there was any, and I think the logged prices are the real prices where the trade was filled.

Thanks, Sphin

Re: Calculating Profit [Re: Sphin] #454919
09/29/15 10:16
09/29/15 10:16
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Is this from a backtest? You can set slippage and swap manually to 0 for precisely calculating the profit. Slippage is a time factor, not expressed in a buy/sell price.

Re: Calculating Profit [Re: jcl] #454924
09/29/15 13:36
09/29/15 13:36
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Yes, it is from a backtest. Setting slippage=0 raises the profit, but leaves also a divergence between calculation and output:

Code:
[EUR/USD::L5901] Long 1@1.3616 Risk 1$ p at 15:00
TradeCosts: 0.10355
[EUR/USD::L5901] Exit 1@1.3633: +1.34 at 15:03



(1.3633-1.3616)*1000-0.10355 ~ 1,6 != 1,34

Swap does not seem not to be a system's variable, but rollover etc. does not play a role in between a trading time of 3 minutes.

Re: Calculating Profit [Re: Sphin] #454939
09/29/15 23:07
09/29/15 23:07
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
In the script Workshop4_1 I set slippage = RollShort = RollLong = 0 and compared the profits from Entry-Exit-TradeCosts with the profits Zorro displays and found the same deviations. It seems that they increase in percentages with the profit, at a profit of 60 e.g. the deviation is about 13 %. The calculation of the TradeCosts is really okay the way it is in the manual?

Re: Calculating Profit [Re: Sphin] #454945
09/30/15 07:09
09/30/15 07:09
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Maybe there's then something missing from the trade costs. I'll check this and will fix the manual if there's a mistake.

Update: No, trade costs are correct as far as I can see. The profit of a long Forex trade, with no swap and slippage, is:

(Endprice-Startprice-Spread)*TradeUnits - Commission*Lots*LotAmount/10000.

In case of a non-Forex trade with 1 lot == 1 contract it's:

(Endprice-Startprice-Spread)*TradeUnits - Commission*Lots.

This should produce the same trade results as calculated by Zorro.

Re: Calculating Profit [Re: jcl] #455286
10/16/15 01:32
10/16/15 01:32
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
TradeUnits is not part of the formula for trade costs in the manual.

Quote:
TradeUnits - Conversion factor from price change to win/loss; depends on PIPCost and volume of the trade ...

Is there an equation to express TradeUnits in lots? Could it be

TradeUnits = Lots*PIPCost/PIP ?

Re: Calculating Profit [Re: Sphin] #455299
10/16/15 14:36
10/16/15 14:36
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Exactly, yes.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1