Enterlong with Limit Order

Posted By: NickL

Enterlong with Limit Order - 02/05/21 06:53

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
Posted By: jcl

Re: Enterlong with Limit Order - 02/05/21 11:30

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
Posted By: NickL

Re: Enterlong with Limit Order - 02/05/21 14:56

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?
Posted By: jcl

Re: Enterlong with Limit Order - 02/08/21 11:42

If you want to backtest it, why not use pending trades instead?
Posted By: NickL

Re: Enterlong with Limit Order - 02/09/21 06:05

OK brilliant. Now I get it. You need to key in an EntryTime, followed by EnterLong with the limit price being the entry limit.
© 2024 lite-C Forums