Problem with trading and optimizing.

 

Ea I'm working on will back test fine however will not enter a trade when placed on a demo chart and also will not take a trade during optimization testing.

The ea is suppose draw trendlines on a chart and then trade accordingly and will only trade in set time ranges of the day.

~ The ea when placed on a chart will currently draw the trendlines correctly but will not attempt to enter a trade.

~I have the trade entering on ordersend and then modifying the order to add the tp and SL after.

~The ea when on a chart will produce no error.

~ The only thing I can think of for why it wouldn't trade or optimize would be because of the trendline drawing.

Do I need to make a seperate indicator to draw the trendlines and then have the ea call the info to trade it?

Is it possible to do it in an ea like I had planned or is this what's causing the issue?

Any other ideas of things/areas to look at if the trendline drawing isn't a problem?

 

use some Print() or Alert() to find out the problem or show your code

 
Trendlines can't be optimized. I found that out the very hard way....Took ages until someboday actually told me here in the forum!