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 (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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