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
2 registered members (degenerate_762, Nymphodora), 1,012 guests, and 3 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
Enterlong with Limit Order #482435
02/05/21 06:53
02/05/21 06:53
Joined: Feb 2021
Posts: 3
PETERSFIELD
N
NickL Offline OP
Guest
NickL  Offline OP
Guest
N

Joined: Feb 2021
Posts: 3
PETERSFIELD
Hi All,

I'm trying to do something very simple but failing to manage this:

1. Do a backtest
3. Enter a Limit Order below current bar close price

I've read the documentation and assume I need:

OrderLimit( 1000 ) ; // set the limit order price to 1000
enterLong(); // enter long with global trade parameters = order limit of 1000

However in a backtest, the trade just executes as a Market Order.

Thanks in advance,
Nick

Re: Enterlong with Limit Order [Re: NickL] #482437
02/05/21 11:30
02/05/21 11:30
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
OrderLimit establishes a limit to orders sent to brokers, if their API supports it. It has no effect on backtests.

https://manual.zorro-project.com/stop.htm

Re: Enterlong with Limit Order [Re: jcl] #482439
02/05/21 14:56
02/05/21 14:56
Joined: Feb 2021
Posts: 3
PETERSFIELD
N
NickL Offline OP
Guest
NickL  Offline OP
Guest
N

Joined: Feb 2021
Posts: 3
PETERSFIELD
Hi - JCL,

Thanks for your help - I did wonder if this might be the case, but good to confirm.

So does that mean there is no way to simulate a Limit order in a backtest?

Re: Enterlong with Limit Order [Re: NickL] #482451
02/08/21 11:42
02/08/21 11:42
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
If you want to backtest it, why not use pending trades instead?

Re: Enterlong with Limit Order [Re: NickL] #482459
02/09/21 06:05
02/09/21 06:05
Joined: Feb 2021
Posts: 3
PETERSFIELD
N
NickL Offline OP
Guest
NickL  Offline OP
Guest
N

Joined: Feb 2021
Posts: 3
PETERSFIELD
OK brilliant. Now I get it. You need to key in an EntryTime, followed by EnterLong with the limit price being the entry limit.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1