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.
Size:
Color:
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?
Size:
Color:
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.
Size:
Color:
Thanks Cone - I want to use just for backtesting.
Size:
Color: