I would like to ask how to code delayed trade entry. After the trade signal is confirmed, wait N bars and then enter (long or short,doesnt matter) I would also like to be able to optimize the number of bars to enter in strategy analyzer - so I can chose between 1,2,3,4,5 or more bars to enter with best results.
My current code for which I intend to do it is as follows, but I quess it should be applicable to other strategies too :
if (Open[0]<Close[0] && Math.Abs(Close[0]-Open[0]) <= ((High[0]-Low[0])*0,5) && Math.Abs(Open[0]-Low[0]) >= ((High[0]-Low[0])*0,3)
EnterLong(Convert.ToInt32(DefaultQuantity), "");
So what code and where to put it to apply the delayed entry after specific number of bars?
Thank you in advance for any help.
Comment