Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 1,558 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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

Chief Engineer
jcl  Offline

Chief Engineer

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