Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
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
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,887 guests, and 6 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
Script/function for BE #439741
04/08/14 10:32
04/08/14 10:32
Joined: Apr 2014
Posts: 10
J
Jauhar Offline OP
Newbie
Jauhar  Offline OP
Newbie
J

Joined: Apr 2014
Posts: 10
Hello everybody,

I am new here and this is my first post. I would like to thank you all, especially jcl, for contributing to this great trading platform.

I have just started writing some simple script in Zorro. I wonder if there is any script/function that calculates the breakeven price of all (short/long/total) open trades of a particular asset.

Cheers,
Jauhar

Re: Script/function for BE [Re: Jauhar] #439745
04/08/14 13:14
04/08/14 13:14
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
The breakeven price of a number of trades is the weighted average of the entry prices. So enumerate all trades, sum up TradeLots*TradePriceOpen of all trades that are open and belong to that asset, and divide the result by the sum of all TradeLots.

Re: Script/function for BE [Re: jcl] #439778
04/09/14 10:41
04/09/14 10:41
Joined: Apr 2014
Posts: 10
J
Jauhar Offline OP
Newbie
Jauhar  Offline OP
Newbie
J

Joined: Apr 2014
Posts: 10
Thanks a lot. It worked as explained.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1