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
3 registered members (AndrewAMD, Nymphodora, Quad), 923 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
Broker API - How to Support Bracket Orders? #470485
01/17/18 12:39
01/17/18 12:39
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
jcl,

I am thinking of supporting bracket orders with my Sierra Chart plugin. I think that this is what I am supposed to do... please critique.


* To begin, there is no such thing as "Trades" in the DTC protocol. There are only orders.
* Although the brokers themselves may be NFA compliant, the user will never use NFA mode.
* Therefore, I will need my own trade management engine built into my plugin.
* After logging in, my plugin will receive a logon response message indicating which features are supported.
* If "OCOOrdersSupported" and "BracketOrdersSupported" are enabled, I can support bracket orders.
* If "UsesMultiplePositionsPerSymbolAndTradeAccount" is enabled, hedging is available. If false, hedging is not allowed (but virtual hedging is).

Logon sequence:

* Plugin logs in.
* Plugin receives configuration data upon logon response.
* User must call GET_COMPLIANCE to confirm settings.

Example: Sierra Chart is used with hedging-allowed forex broker.
* GET_COMPLIANCE == 0 (no restrictions)

Example: Sierra Chart is used with futures or stocks broker, such as IB.
* GET_COMPLIANCE == 2 (no hedging)

Example: Sierra Chart is used with NFA-compliant forex broker.
* GET_COMPLIANCE == 3 (FIFO compliance)

Example: Sierra Chart is used with NFA-compliant forex broker, and bracket orders are not supported for some reason.
* GET_COMPLIANCE == 7 (FIFO compliance + no stop loss)

Re: Broker API - How to Support Bracket Orders [Re: AndrewAMD] #470490
01/17/18 13:47
01/17/18 13:47
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
Hi, Andrew,

great you are progressing with SC plug-in!

Re your questions:

1) I do not think there will be any "Hedging-allowed" FX broker available via SC.
"Hedging-allowed" mode is a "feature" of MT4/5; so any trades bypassing MT servers of a broker will not be "hedging-allowed".
And none of SC integrations are with broker MT systems.

e.g. FXCM,LMAX,Gain trading via SC is FIX-based and so is NFA compliant by definition.

2) The key benefit of using orders "resting" in a broker's OMS vs. simulating their execution in Zorro is, of course, reduced slippage.
Will defining a BrokerStop function/StopFactor not help?

Cheers.

Re: Broker API - How to Support Bracket Orders [Re: Zheka] #470493
01/17/18 14:07
01/17/18 14:07
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
#1 - Currently, yes. Yet, SC uses this flag: "UsesMultiplePositionsPerSymbolAndTradeAccount". A responsible plugin writer will account for this in case SC adds such a broker. You never know.

Quote:
e.g. FXCM,LMAX,Gain trading via SC is FIX-based and so is NFA compliant by definition.
By the way, NFA compliance and Zorro's NFA mode are two very different things.

#2 - The idea behind my method is that the bracket-child-orders will sit with the broker. Plugin receives pool trades and places all orders as needed, including bracket stop orders and bracket limit orders. The user interface will be "trades".

Attached Files trade_model.PNG
Re: Broker API - How to Support Bracket Orders [Re: AndrewAMD] #470496
01/17/18 15:39
01/17/18 15:39
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
From what I know, SC will not do this as a matter of principle.
There had been several requests for integration with MT, and by the way(and reason) such requests had been rejected I would say the probability of this is big phat zero.
Besides, their development pipeline is full for the next couple of years (look also their latest "What SC is working on post").
And you will not even have the possibility to test it.
But can ask them directly,anyway...

Re: Broker API - How to Support Bracket Orders [Re: Zheka] #470499
01/17/18 15:46
01/17/18 15:46
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Don't bother them with such questions. I don't need to test a boolean.

Before this topic gets completely derailed, I should reiterate that this topic is about how to write a plugin with bracket support.

jcl, is my method correct?

Re: Broker API - How to Support Bracket Orders [Re: AndrewAMD] #470502
01/17/18 16:02
01/17/18 16:02
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes. Currently the GET_COMPLIANCE function is for script use only, and not internally called by Zorro. But we can do that in a future version for automatically determining NFA and Hedge modes.

Re: Broker API - How to Support Bracket Orders [Re: jcl] #470506
01/17/18 16:11
01/17/18 16:11
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Originally Posted By: jcl
Yes. Currently the GET_COMPLIANCE function is for script use only, and not internally called by Zorro. But we can do that in a future version for automatically determining NFA and Hedge modes.
You can put this on hold. I'm not sure if SC necessarily changes those flags per broker. I will need to ask them.

They created this universal DTC protocol (it's like FIX, but in binary and quite compact). Then they pick and choose which features their program will actually use.

Anyways, I think I know how to proceed now. Thanks.


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