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
1 registered members (TipmyPip), 18,038 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
CFDs / open contracts at broker / evaluation per tick #462042
09/05/16 15:55
09/05/16 15:55
Joined: Sep 2016
Posts: 7
C
cc_ Offline OP
Newbie
cc_  Offline OP
Newbie
C

Joined: Sep 2016
Posts: 7
Greetings.
I am interested in CFD trading and there are some hints that Zorro support that, but not many, so i am not sure. Does Zorro support CFDs ?
If yes, then i would be interest3ed to understand if the Scripting language supports enumerating and evaluating all open contracts in a brokers account. I noticed there there are queries support for the current total position for a product eg in stocks, but for CFDs i would need the entry price of each individual contract on the same underlying product. Is this possible ?
And lastly i understand Zorro works on bars in predefined timeframes (eg 1 minute bars). Is it possible to evaluate on each tick too ?
Thanks for your support.

Re: CFDs / open contracts at broker / evaluation per tick [Re: cc_] #462046
09/05/16 16:44
09/05/16 16:44
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
A CFD is a contract for difference. Meaning the difference of entry and exit. Since two prices can have only one difference, you can only open one CFD at any point, not different contracts or individual entry prices. - Yes, on each tick too.

Re: CFDs / open contracts at broker / evaluation per tick [Re: jcl] #462049
09/05/16 17:21
09/05/16 17:21
Joined: Sep 2016
Posts: 7
C
cc_ Offline OP
Newbie
cc_  Offline OP
Newbie
C

Joined: Sep 2016
Posts: 7
You can open as many CFD contracts on a given underlying as you can afford buying into.
Each of them has the entry price achieved at the time you made the contract. If you have multiple contracts, it is likely they have all different entry prices. And for each of them you will probably exit them with a different exit price. Consequently each of them will produce a different result. So each one produces one such single difference.
Example from flat position buying three 3 CFDs at different times without closing any manually:

Time Product L/S Lots EntryPrice StopLoss TakeProfit
8:30 GER30 S 0.1 10728 10878
9:30 GER30 S 0.2 10722 10867 10700
10:30 GER30 S 0.2 10720 10870

At 15:30 with GER30 @10688 you will have two open contracts one with entry price 10728 and one with entry price 10720. Thus one is 40 points, the other 32 points in gain.
It helps the strategy to understand which contracts are open.

Re: CFDs / open contracts at broker / evaluation per tick [Re: cc_] #462059
09/06/16 07:12
09/06/16 07:12
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
What exactly was then your issue with CFDs? If your script opens 3 trades, you have 3 trades and can evaluate them all. It does not matter if they produce only a single total position on your account.

It depends on the broker if you can have individual contracts of the same asset, not on the trade software or asset type.

Re: CFDs / open contracts at broker / evaluation per tick [Re: jcl] #462069
09/06/16 17:15
09/06/16 17:15
Joined: Sep 2016
Posts: 7
C
cc_ Offline OP
Newbie
cc_  Offline OP
Newbie
C

Joined: Sep 2016
Posts: 7
I would like to understand if Zorro can retrieve / reconcile open contracts from the broker and evaluate each open contracts data (entry price, TP, SL, size) individually taking into account that they are on the same underlying in comparison to a stock position where an aggregate value per stock might be sufficient. So if in above example at 15:30 i just start Zorro, is it possible to read from the broker that there are two open contracts and retrieve said data for each of the two contracts ?

> If your script opens 3 trades, you have 3 trades and can evaluate them all.
If i'm missing the signal that trade 2 hit TP and the GER30 value went back below TP, will Zorro be able to find out ?

Last edited by cc_; 09/06/16 17:26.
Re: CFDs / open contracts at broker / evaluation per tick [Re: cc_] #462070
09/06/16 17:30
09/06/16 17:30
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Yes, but not from the broker. Only from Zorro's stored trade list. From the broker you get only the net position, from some also a list of open trades, but no details.

Re: CFDs / open contracts at broker / evaluation per tick [Re: jcl] #462073
09/06/16 20:02
09/06/16 20:02
Joined: Sep 2016
Posts: 7
C
cc_ Offline OP
Newbie
cc_  Offline OP
Newbie
C

Joined: Sep 2016
Posts: 7
http://undocumentedmatlab.com/files/IB-Matlab_User_Guide.pdf

Chapter 4.2 should mean it's possible with IB

i think its reqPositions() in java API

Re: CFDs / open contracts at broker / evaluation per tick [Re: cc_] #462077
09/07/16 07:57
09/07/16 07:57
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
IB is a NFA compliant broker. They store no individual trades, only a position.


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