Sell at end of February and Buy March
Author: novendeh
Creation Date: 12/20/2010 8:43 PM
profile picture

novendeh

#1
The following code compiles but has a run-time error. I can't figure out what is wrong. It tries to sell at end of Feb and Buy March.
CODE:
Please log in to see this code.
profile picture

novendeh

#2
Neglect this question. I realized I needed to change loop end to bar.count-1.

Is there any way to delete a post after I posted it, but not one else responded?
profile picture

Cone

#3
If you change the end of the end of the loop to not process the last bar, that's fine for backtesting, but it won't Alert properly. It would be better to process the last bar as shown above and add logic that determines when you're on the last trading day in February.
profile picture

novendeh

#4
Thanks Cone - I want to use just for backtesting.
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).