how to use OBJ_TREND

Back to topics list To post a new topic, please log in or register
avatar
11
fareshanab 2013.05.26 05:51
 

dear all

How to use OBJ_TREND to draw trend line from the High of day snd the High of previous day

 

I make this code , but not workable , what is the correct code

 

 

  double Hi0=iHigh(Symbol(),PERIOD_D1,0);    

 double Hi1=iHigh(Symbol(),PERIOD_D1,1);

 

ObjectCreate("mytest",OBJ_TREND,0,Time[0],Hi1,Hi0);

         ObjectSet("mytest",OBJPROP_RAY,True);

         ObjectSet("mytest",OBJPROP_BACK,True)  ;                

         ObjectSet("mytest",OBJPROP_STYLE,STYLE_DOT);

         ObjectSet("mytest",OBJPROP_WIDTH,1);

         ObjectSet("mytest",OBJPROP_COLOR,Lime); 

 
avatar
14167
RaptorUK 2013.05.26 10:20 #
 
fareshanab:

dear all

How to use OBJ_TREND to draw trend line from the High of day snd the High of previous day

 

I make this code , but not workable , what is the correct code

<CODE DELETED>

Please read some other posts before posting . . .

Please edit your post . . .    please use the   SRC   button to post code: How to use the   SRC   button. 



avatar
14167
RaptorUK 2013.05.26 10:23 #
 
fareshanab:

dear all

How to use OBJ_TREND to draw trend line from the High of day snd the High of previous day

I make this code , but not workable , what is the correct code

A Trend Line needs 2 sets of time, price coordinates,  a start point and an end point . . .  please look at the documentation for ObjectCreate()   You have this:

ObjectCreate("mytest", OBJ_TREND, 0,  Time[0], Hi1, Hi0 );

 you have,  datetime, price, price  instead of  datetime time1, double price1, datetime time2, double price2

 
avatar
11
fareshanab 2013.05.26 11:04 #
 

Thank you

I make this code as follow , but not workable

double Hi0=iHigh(Symbol(),PERIOD_D1,0);    

 double Hi1=iHigh(Symbol(),PERIOD_D1,1);

 

ObjectCreate("mytest",OBJ_TREND,0,Time[0],Hi1,Time[0],Hi0,Time[0]);

         ObjectSet("mytest",OBJPROP_RAY,True);

         ObjectSet("mytest",OBJPROP_BACK,True)  ;                

         ObjectSet("mytest",OBJPROP_STYLE,STYLE_DOT);

         ObjectSet("mytest",OBJPROP_WIDTH,1);

         ObjectSet("mytest",OBJPROP_COLOR,Lime);

 

avatar
14167
RaptorUK 2013.05.26 11:15 #
 
fareshanab:

Thank you

I make this code as follow , but not workable

Why do you have 3 datetime parameters   ?  

ObjectCreate("mytest",OBJ_TREND,0 Time[0],  Hi1,  Time[0],  Hi0,  Time[0] );

 

please,  read the documentation   ObjectCreate() 

avatar
215
buju 2016.08.23 22:52 #
 
.
.
.
// trigger to start time , price start

tStart = Time[0];
priceStart = Close[0];
            
    
   string trend = "trend"; 
   ObjectDelete(trend);
     // ObjectDelete(trend);
      ObjectCreate( trend, OBJ_TREND,0, tStart, priceStart, Time[0], Ask );
    // ObjectSet(trend, OBJPROP_STYLE, 1);
    // ObjectSet(trend, OBJPROP_WIDTH, 1);
    //  ObjectSet(trend, OBJPROP_COLOR, LightBlue);  
   

avatar
Moderator
3404
GumRai 2016.08.24 00:32 #
 

buju:


tStart = Time[0];

ObjectCreate( trend, OBJ_TREND,0, tStart, priceStart, Time[0], Ask );
Your 2 time coordinates are the same, is that your intention?
Back to topics list  

To add comments, please log in or register