View Single Post
  #13 (permalink)  
Old 05-10-2007, 03:31 AM
Bill R Bill R is offline
Sophomore
 
Join Date: Jul 2006
Posts: 40
Thanks: 2
Thanked 4 Times in 3 Posts
Bill R is on a distinguished road
Default

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.
Reply With Quote

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now

Main Menu

Economic Forecast