I have written a simple back testing program for my strategy and I am now stuck. The program works fine, except that if an additional buy condition occurs before my sell condition is triggered, it just ignores the additional sell condition (which I want included). For example, If my strategy says to buy when the price low touches the lower Bollinger Band, and to sell when it touches the upper band, I want it to include another buy if it touches down twice before touching the upper band. This is the code I have currently which isn’t working:
def BUY = Low <= lowerBand;
AddOrder(OrderType.BUY_TO_OPEN, BUY, tickcolor = GetColor(1), arrowcolor = GetColor(1), name = “BUY”);
Any help you can provide would be much appreciated. Thanks, Ron
Marked as spam
Please log in to post questions.