Gamestudio Links
Zorro Links
Newest Posts
Votes for future features
by DdlV
Yesterday at 23:46
Project Aum - Winter Contest 2017 - Update
by George
Yesterday at 22:37
hold key code returns very high value instead of 0 or 1
by 3run
Yesterday at 16:08
oldschool fps project
by 3run
Yesterday at 15:46
Sam Foster Sound | Experienced Indie Game Composer for Hire
by titanicpiano14
Yesterday at 15:02
[ALL STYLES] 2D Videogame Artist (pixel, vector, painted)
by DesixStudios
12/15/17 14:45
Easy question
by jcl
12/15/17 13:47
AUM Magazine
Latest Screens
RPG PARTY
Triton Wing now available on Steam
AckCon'17: Lotter vs The World
Triton Wing
Who's Online
12 registered (Ch40zzC0d3r, Dico, 3run, boatman, AndrewAMD, alibaba, easyX, 4 invisible), 451 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Meisterbene, Amocfx, cme, pataba, byano
17835 Registered Users
Page 2 of 2 < 1 2
Topic Options
Rate This Topic
#469689 - 12/02/17 17:34 Re: Broker API - Options Questions [Re: jcl]
AndrewAMD Online
Member

Registered: 02/21/17
Posts: 121
Loc: Chicago
Originally Posted By: jcl
For buying and selling an option, the symbol is passed in char* Asset, coded in the way as described on the "IB" page of the manual.
jcl,

Is there some way that my plugin can define a futures/options/futures-options contract symbol so that Zorro's use of char* Asset always matches that of my broker?

I mean like this:
* Zorro calls GET_OPTIONS or GET_FUTURES.
* Plugin copies the CONTRACT structs and then return a **negative** number of contracts to indicate that the plugin has symbols to supply. Plugin saves the symbols.
* Zorro calls a new function GET_OPTIONS_SYMBOLS or GET_FUTURES_SYMBOLS. Zorro provides a pointer to an array of strings, and the plugin copies the symbols to the array of strings.
* The number of CONTRACT structs and symbols would therefore be identical.
* Any BrokerAsset, BrokerHistory2, and BrokerBuy call using one of these contracts would therefore use the respective symbol for char* Asset.

This would be especially helpful to me, since my SC plugin will be multi-broker.

Top
#469758 - 12/06/17 18:36 Re: Broker API - Options Questions [Re: AndrewAMD]
AndrewAMD Online
Member

Registered: 02/21/17
Posts: 121
Loc: Chicago
bump

Top
#469769 - 12/07/17 16:46 Re: Broker API - Options Questions [Re: AndrewAMD]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26002
Loc: Frankfurt
The symbols are fact already loaded, only it's an undocumented function because it's not used yet. The string is stored at the begin of any CONTRACT* struct in the Contracts list, instead of the date that is not needed in the options chain.

So, string Class = Contracts + ContractRow should get the symbol of the current contract.

Top
#469774 - 12/07/17 18:26 Re: Broker API - Options Questions [Re: jcl]
AndrewAMD Online
Member

Registered: 02/21/17
Posts: 121
Loc: Chicago
Originally Posted By: jcl
The symbols are fact already loaded, only it's an undocumented function because it's not used yet. The Symbol string is stored at the begin of any CONTRACT* struct in the Contracts list, instead of the date that is not needed in the options chain.

So, string CSymbol = Contracts + ContractRow should get the symbol of the current contract.
Earlier in the thread, you gave me this line of code:
Code:
strcpy_s((char*)g_Contracts,8,C.tradingClass.c_str());

... and you said it was reserved for the trading class. Are you saying that this has been changed to the actual symbol?

Back to the struct...
Code:
typedef struct CONTRACT
{
	DATE	time;			// or trading class
	float fAsk, fBid; // premium without multiplier (f1,f2)
	float fVal;			// open interest or multiplier (f3)
	float fVol;			// volume (f4)
	float fUnl;			// unadjusted underlying price (f5)
	float fStrike;		// (f6)
	long	Expiry;		// YYYYMMDD (i7)
	long	Type;			// PUT, CALL, FUTURE, EUROPEAN, BINARY (s8)
} CONTRACT; // for options, futures, FOPs

"time" only has room for 8 characters... I don't think that's enough room for an options / futures / FOP symbol.

Did you mean that I can overwrite fAsk and fBid as well, giving me 16 characters?

Top
#469776 - 12/08/17 08:35 Re: Broker API - Options Questions [Re: AndrewAMD]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26002
Loc: Frankfurt
No. I thought you were talking about the class. What is then a "symbol"?

Top
#469777 - 12/08/17 12:34 Re: Broker API - Options Questions [Re: jcl]
AndrewAMD Online
Member

Registered: 02/21/17
Posts: 121
Loc: Chicago
The equivalent of char* Asset.

Top
#469778 - 12/08/17 16:46 Re: Broker API - Options Questions [Re: AndrewAMD]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26002
Loc: Frankfurt
Like "AAPL" for Apple options?

Top
#469784 - 12/08/17 17:29 Re: Broker API - Options Questions [Re: jcl]
AndrewAMD Online
Member

Registered: 02/21/17
Posts: 121
Loc: Chicago
I mean the complete "ticker symbol" to represent a specific future or option or futures option which, in the symbol itself, indicates:
* core or underlying symbol ("ES" for e-mini, "AAPL" for Apple)
* call or put or future, etc.
* futures expiration month (if applicable)
* strike price (if applicable)
* exchange (depending on the broker)

... all of those things in one string.

But you see, I have an engineering problem: The nomenclature is completely different for every broker, and I need a universal approach to support them all:
* IB has unique nomenclature
* TD Ameritrade has unique nomenclature
* CQG has unique nomenclature
* and so on.

I am already able to define the contract structs. I simply would like to be able to define the complete "ticker symbol" as well.

So I'm asking for a pointer to an array of strings - that way, I can give Zorro the complete "ticker symbols".

The intent is for BrokerAsset (and other plugin calls) to use this complete ticker symbol for char* Asset.

Is this possible?

Top
#469787 - 12/08/17 17:46 Re: Broker API - Options Questions [Re: AndrewAMD]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26002
Loc: Frankfurt
Do you mean a code like "AAPL-OPT-150-20180303-USD"? That's not supplied by the plugin. It is an internal code used only by Zorro for sending strike, expiry and other parameters to the IB plugin. The API does not know this code. If broker APIs have similar codes in internal lists, they are then broker specific, and not used by Zorro.


Top
Page 2 of 2 < 1 2



Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) 3dgamestudio.net