My trigger for entry first requires a series of filters to be positive after which a change in direction of the RSI will allow an entry. I've coded a print statement in the strategy which shows that all filters are positive (i.e. variable "DirShrt" = 1) for 3 bars in succession during a certain period on the chart. The print statement first shows the time and then the value for the variable "DirShrt".
E.g. my print results shows like this:
6/10/2009 9:59:17 AM DirShrt=1
6/10/2009 10:00:05 AM DirShrt=1
6/10/2009 10:00:57 AM DirShrt=1
6/10/2009 10:01:13 AM DirShrt=0
This is just as it should be. However during the second bar the RSI value reaches a maximum and thus the RSI for the 3rd bar is less than the RSI for the second bar. Since my strategy should enter the trade in this situation I expect an entry. Instead I don't have one. I added another print statement just ahead of the entry code something like this
if (RSI[0] < RSI[1]) {print (Time + "RSI turned down");}
This statement does not show up on the third bar even though the RSI value for the 3rd bar is less than that of the 2nd bar. Instead it shows up for the time which corresponds to the 4th bar. And this is why I'm not getting my entry. By the 4th bar the directional filters no longer allow a short entry. But the conditions for the short entry did exist at the third bar, as well as the decreasing RSI value.
To check what's going on again I added the RSI value to my first print statement. This shows conclusively that the strategy sees a lower RSI value for the 3rd bar, but it still won't give an affirmative response to a logic statement with the condition "if (RSI[0] <RSI[1])". [SEE BELOW]
What's going on????
6/10/2009 10:00:57 AM, RSI=81.43, RSI[1]=81.41, DirLng=0, DirShrt=1
6/10/2009 10:01:13 AM, RSI=68.19, RSI[1]=81.43, DirLng=0, DirShrt=0
6/10/2009 10:01:13 AM, RSX Turned Down
Thanks
RSI77

Comment