I have a small routine to trace wins/losses when they get erased from a chart:
ObjectsDeleteAll( EMPTY, OBJ_TREND );
for( i = 0; i < HT; i++ )
if( OrderSelect( i, SELECT_BY_POS, MODE_HISTORY ) )
{
ObjectCreate( "TrendH"+i, OBJ_TREND, 0, OrderOpenTime(), OrderOpenPrice(), OrderCloseTime(), OrderClosePrice());
ObjectSet( "TrendH"+i, OBJPROP_WIDTH, 2 );
ObjectSet( "TrendH"+i, OBJPROP_RAY, False );
ObjectSet( "TrendH"+i, OBJPROP_STYLE, STYLE_DOT );
if ( OrderType()==OP_BUY )
if ( OrderOpenPrice() < OrderClosePrice() ) ObjectSet( "TrendH"+i, OBJPROP_COLOR, Green );
else ObjectSet( "TrendH"+i, OBJPROP_COLOR, Red );
else if ( OrderType()==OP_SELL )
if ( OrderOpenPrice() > OrderClosePrice() ) ObjectSet( "TrendH"+i, OBJPROP_COLOR, Green );
else ObjectSet( "TrendH"+i, OBJPROP_COLOR, Red );
}
Of course, anybody can use any of this that you want in your EA.
Problem is, I'd like the OBJPROP_STYLE line to function and it doesn't. Does anybody know of a resource that tells you which properties apply to which objects? You'd think STYLE applies to trendline object types, but it doesn't seem to, unless there's still another property that turns this one on/off. Any help would be appreciated.