Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
Deeplearning Script
by wolfi. 02/26/24 12:46
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/22/24 16:22
AssetAdd() vs. modern asset list?
by jcl. 02/21/24 15:01
How many still using A8
by Aku_Aku. 02/20/24 12:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 567 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
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: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
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