I am back again. I have been working with zorro for a few months now and I was very happy with its performance.
I am currently trying to begin coding a very simple strategy that exploits the natural tendencies of gaps in price over the weekend to close. But of course I am having trouble creating the code.
I need the computer to compare the opening price on Sunday 5pm to the closing price at the prior Friday 5pm.
So looking through the manual I figure it should be something along these lines perhaps.
If (current bar's opening time is equal to 5pm EST Sunday night) then (subtract fridays 5pm EST close price) to generate a value called GAP
if abs(GAP) > some value we trade and if less than that value we do nothing
If we trade I will use this GAP value to calculate the entries, stops and limits.
I was confused about coding the first part, the comparison. Would this work:
If hour(0) = 5 and dow(0) = 7 then I would calculate a variable designated GAP like this:
GAP = OpenPrice(0) - timeOffset(ET,1,16,0)
Then I would use this GAP variable further down to decide on whether I will place a trade and how to place it.
Is this the way to code this? Any ideas or advice would be greatly appreciated.