Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (rki), 405 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Limit Order Entry #481562
09/29/20 18:39
09/29/20 18:39
Joined: Sep 2020
Posts: 8
New York, NY
B
BigSky Offline OP
Newbie
BigSky  Offline OP
Newbie
B

Joined: Sep 2020
Posts: 8
New York, NY
I am trying to write a simple system that enters/exits using limit orders. Its' strange that something so trivial to accomplish in Multicharts, TradeStation, Amibroker etc should be so complicated in Zorro.

I gather from the manual that an order entered using enterLong(1, limitprice) will be treated at market-if-touched orders by Zorro.

I further realize that Zorro can handle limit orders properly, assuming the broker can handle them (is there a broker that doesn't handle limit orders?). I am trading on IB.

So I need to use some kind of Trade Management Function to accomplish this simple task.

Can anyone point to an example in the documentation of code to issue a limit entry order ?

Or can anyone provide a simple example of a suitable TMF and how it should be called?

Thanks!

Last edited by BigSky; 09/29/20 19:38.
Re: Limit Order Entry [Re: BigSky] #481563
09/29/20 19:01
09/29/20 19:01
Joined: Mar 2019
Posts: 357
D
danatrader Offline
Senior Member
danatrader  Offline
Senior Member
D

Joined: Mar 2019
Posts: 357
https://zorro-trader.com/manual/en/buylong.htm


Example 2: Grid trading script -> sample


Entry Optional entry stop when > 0, entry limit when < 0 (overrides the global Entry).

Although, using TMF or tick function can be definitly challenging.

Last edited by danatrader; 09/29/20 19:16.
Re: Limit Order Entry [Re: danatrader] #481564
09/29/20 19:42
09/29/20 19:42
Joined: Sep 2020
Posts: 8
New York, NY
B
BigSky Offline OP
Newbie
BigSky  Offline OP
Newbie
B

Joined: Sep 2020
Posts: 8
New York, NY
Nope, doesn't work. Thats exactly what I meant when I wrote the following:

"I gather from the manual that an order entered using enterLong(1, limitprice) will be treated at market-if-touched orders by Zorro."

Assuming limitprice < 0 , Zorro treats this as a limit order, at least in theory. Except it doesn't. In fact it treats it as a market-if-touched order. Completely different (slippage).

So you have to use a TMF to get a proper limit order executed. The question is how? I cant find a single, clean example in the documentation.

Re: Limit Order Entry [Re: BigSky] #481574
09/30/20 15:52
09/30/20 15:52
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
What you need is the "OrderLimit" - which will send a real limit order to IB. Search the manual for "OrderLimit" and then EntryTime/ OrderDelay/SET_ORDERTYPE.

Also, study the "IB Plugin" page and SET_ORDERTEXT which allows to use most order types (adaptive, etc) available via IB.

Last edited by Zheka; 09/30/20 15:57.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1