Code does not go Short on Winter months
Author: gbullr
Creation Date: 3/9/2012 5:58 PM
profile picture

gbullr

#1
The following code generates trades

CODE:
Please log in to see this code.


the following code does not

CODE:
Please log in to see this code.



Difference is the // above the short at market.
Something weird going on ... trying to short only in north American winter. What stupid mistake am I making.
I have changed pctdownsums so I know that is not the problem.

Much appreciate your help.


profile picture

Eugene

#2
Give it a little thought:
CODE:
Please log in to see this code.

How can a number be greater than 10 (e.g. 11) and be less than 3 at the same time? That's impossible.

Code logic requires an OR, not AND:
CODE:
Please log in to see this code.
profile picture

gbullr

#3
Thanks I did not realize that Date Time did not have the reset at 12 logic built in.

Thanks.

profile picture

Eugene

#4
It's not a DateTime thing. You're comparing two integer numbers.
profile picture

gbullr

#5
Another issue w/ DateTime.

On Symbol = .SPX

This code does not buy in the years 2001 2002 2006 or 2007. Do you know why?

CODE:
Please log in to see this code.


Thanks. I have the same problem w/ the yahoo symbol ^GSPC. Can't figure it out.

profile picture

Eugene

#6
14 April 2007 was Saturday. Do I really have to look up the other dates?
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).