[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trendline breakout problem



PureBytes Links

Trading Reference Links

Hello List,

I've been experimenting with a very simple trendline breakout system, just
to make sure it works as I hoped to. I first deleted all drawing objects
from the chart, then added a new trendline (its ID was understandably #0).
This is a downward sloping trendline and I made sure that the close crosses
above it at one point. The code is as follows:


Value1=TL_GetBeginDate(0);
Value2=TL_GetBeginTime(0);
Value3=TL_GetBeginVal(0);
Value4=TL_GetEnddate(0);
Value5=TL_GetEndTime(0);
Value6=TL_GetEndVal(0);
Value7=TL_New(Value1,Value2,Value3,Value4,Value5,Value6);

If Date>Value1 and Date<value4 then begin
if close crosses above Value7 then buy this bar 1 contract on close;
end;

{values 1 and 4 are 2 different dates on the chart, covering trendline's
period}


I applied this strategy to the chart... There are NO trades in Strategy
Performance Report (although the close DOES cross above the trendline), and
funniest of all - TradeStation changed the TL ID from #0 to #1740!!!
LOL. I changed the code above replacing 0s with 1740s and sure enough, the
TL ID on the chart was 0 back again, LOL.

Am I missing something? Any other way to do this?

Thanks, and all the best

Yarroll