ObjectCreate() enumeration missunderstanding?

Back to topics list To post a new topic, please log in or register
avatar
52
renzbub 2015.06.05 13:53
 

Why is it that within ObjectCreate() parameters when I set enumeration OBJ_TREND it understands anchor points okay and draws the line correctly like so

void OnInit() 
{  
   // Finding 1st highest high on price (3 bars back)
   int highest1 = iHighest(NULL,0,MODE_HIGH,2,0);  
   double highestHigh1 = High[highest1];
   datetime time1 = iTime(NULL,0,highest1);       
   
   // Finding previous 2nd highest high on price  (starts 9 bars back to 20)
   int highest2 = iHighest(NULL,0,MODE_HIGH,100,3); 
   double highestHigh2 = High[highest2];  
   datetime time2 = iTime(NULL,0,highest2);      
   
   ObjectCreate("Trend",OBJ_TREND,0,time1,highestHigh1,time2,highestHigh2);  
}  

but when I use enumeration OBJ_TRENDBYANGLE it always makes the angle 0 and is therefore not reading the anchor points?




avatar
13001
WHRoeder 2015.06.05 14:42 #
 
Create the object with one coordinate, then set the angle like the example shows. OBJ_TRENDBYANGLE - MQL4 Documentation



Back to topics list  

To add comments, please log in or register