Entry at opening price

Posted By: MagnusM

Entry at opening price - 08/26/20 22:30

Hi,

I'm new to Zorro. I'm trying to make a backtest script based on gap percentage on a daily chart. So if the stock gap up more then let's say 2% in the morning, enter long. The issue is that the enter long funtion is entering at the closing price of the candle, it should trigger at the opening price instead . Any ideas?
Posted By: jmlocatelli

Re: Entry at opening price - 08/27/20 14:13

HI,

In TestMode you can check the next day open price using priceOpen(-1) and SET(PEEK).
Then use Fill = 3 before EnterLong/EnterShort to open the position at open next bar.
© 2024 lite-C Forums