Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, Quad, VoroneTZ, 1 invisible), 623 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Re: IB Plugin needs a fix [Re: Zheka] #469228
11/09/17 07:37
11/09/17 07:37
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
When you look in the API doc, you can see that you need two orders for a stop loss trade. This is NFA compliance and not at the broker`s liberty. Stop orders with NFA brokers are not planned at this point, but maybe in a future version.

Re: IB Plugin needs a fix [Re: jcl] #469235
11/09/17 11:23
11/09/17 11:23
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
JCL,

IB 1000% allows to submit Stop orders via their API regardless if those are entry or exit orders. Stops at IB will become market orders much faster then when Zorro does the same.

In none of the current IB Links is there any mention of "two orders" (or NFA):

https://interactivebrokers.github.io/tws-api/basic_orders.html#stop&gsc.tab=0
https://www.interactivebrokers.com/en/index.php?f=609
https://www.interactivebrokers.com/en/index.php?f=719

Where in IB API docs is there a reference to the need to place 2 orders? (and which ones?)

I trade with both MultiCharts and Sierra Charts, and both have been sending stop orders (entry and exit) to IB without any problem.

https://www.multicharts.com/trading-software/index.php/Order_Types
https://www.sierrachart.com/index.php?page=doc/InteractiveBrokers.php#IBStopOrderTriggerMethod

Where is the catch?

Re: IB Plugin needs a fix [Re: Zheka] #469239
11/09/17 14:26
11/09/17 14:26
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
"Trades" and "Orders" are two different things.

A stop order is still only an order. Zorro was designed to manage "trades". Consider the implications for the plugin development process.

Re: IB Plugin needs a fix [Re: AndrewAMD] #469244
11/09/17 15:27
11/09/17 15:27
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Correct. Opening 1 _Trade_ with a stop loss requires 2 _Orders_.

For a stop loss trade in the IB API, you first open a market order in the desired direction. Then you open a stop order in the opposite direction. IB also requires some "bracket" mechanism for preventing that the second order is opened when the first was not. The result is an open stop loss trade in NFA compliant way. Even though you used to click a single button for this in Multicharts or Sierracharts. wink

Re: IB Plugin needs a fix [Re: jcl] #469251
11/09/17 18:29
11/09/17 18:29
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
A "Stop-loss trade"?? That's really something new from the world of MT smirk

IB API does not require any "bracket" mechanism - it works with raw orders. It is perfectly ok to submit a stop order with or without an existing position (or other orders to open a position).

I understand the roots of Zorro, but find it difficult to believe that it needs to continue to be confined to the Metatrader model. (with the consequence that all further broker integrations need to dance around these self-imposed restrictions).
If an API allows to place a stop or limit order - let the plug-in place it. It is probably simpler to just do it, than simulate internally.

Or implement BrokerStop() and BrokerLimit(), and/or extend the order() function to allow advanced user to implement any of the huge variety of order types offered by IB.

Freedom! Freedom! smile

Re: IB Plugin needs a fix [Re: Zheka] #469274
11/10/17 08:01
11/10/17 08:01
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I see my didactic limits, but think this brief discussion can now be concluded.

Re: IB Plugin needs a fix [Re: jcl] #469291
11/10/17 13:34
11/10/17 13:34
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline
Junior Member
mhdus  Offline
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
Without daring to dig again into the details already discussed here - but more generally I believe Zheka is right in the observation that the Zorro philosophy how to see/manage trades vs. orders/positions is (too) heavily tied to the MT approach.
Maybe it requires a rather strategic decision at some point if Zorro is supposed to support "official" markets (official exchanges such as CBOE, NYSE and the like, via brokers such as IB) or "proprietary" markets (market making MT brokers) or both, in full awareness that the requirements/approaches/methods can be significantly different for these different environments.
My personal view is that Zorro needs more adaption to IB type brokers if you want it to compete with alternatives such as Ninja Trader, Tradestation, etc. - even if (or just because?) Zorro's technical capabilities are already way superior. You recently made a major step into this direction by adding options and futures support. I think it would be more than consequent to do the natural next step with a more powerful IB plugin using the most common 80% of its wealth of additional features. I understand the additional efforts - and I could even understand if this would require a (reasonably priced) "ZorroS+" version...

Re: IB Plugin needs a fix [Re: mhdus] #469292
11/10/17 14:14
11/10/17 14:14
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I am not sure what an MT approach is, but if you mean the concept of trades, it has a simple reason - most strategy scripts are much easier to write with trades than with orders and positions. Even though 80% of Zorro strategy jobs at the moment use brokers with order/position APIs.

Re: IB Plugin needs a fix [Re: jcl] #469293
11/10/17 14:40
11/10/17 14:40
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline
Junior Member
mhdus  Offline
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
Yes, the concept of a "trade" as a logical entity is what I meant by "MT approach". Maybe there is more behind the scenes. Trades as logical entities do not exist in the world of official exchanges. The strategic question to answer is if Zorro internally needs this concept by all means (just for historical reasons or even better reasons?) or not. This is your decision as developers, of course. Just trying to explain from an IB trader's perspective where the conceptual challenge is. Eventually there is room for compromise...

Re: IB Plugin needs a fix [Re: mhdus] #469296
11/10/17 15:20
11/10/17 15:20
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted By: mhdus
Eventually there is room for compromise...
Would a user want the ability to place explicit orders or set an absolute net position (long/short) for the current Asset?

Page 4 of 5 1 2 3 4 5

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