plotting of arrows in terminal.

 

hello all,


i dont understand how to plot arrows in terminal..I have seen many mq4 files for candle stick pattern recognition but could not understand

why the objectcreate and objectset are different commands in mql language...

objectcreate creates objects in memory only,then why they arre created if not plotted....i think objectcreate should be merged into objectset for making mql more easy to understand....

whats the purpose of index parameter in  ObjectSet( string name, int index, double value) command..??

 
ankit29030:

hello all,


i dont understand how to plot arrows in terminal..I have seen many mq4 files for candle stick pattern recognition but could not understand

why the objectcreate and objectset are different commands in mql language...

objectcreate creates objects in memory only,then why they arre created if not plotted....i think objectcreate should be merged into objectset for making mql more easy to understand....

whats the purpose of index parameter in  ObjectSet( string name, int index, double value) command..??

If you want to change the colour of an Object why do you want to have to delete it and then create it all over again ?  why not simply change it's colour ?  this is the point of ObjectSet(),  did you read the documentation ?  why do you want an overly long and complicated ObjectCreate() function call that contains window, colour, font, line style, line width, arrow code, time1, time2, time3, price1, price2, price3, ray, etc . . .  how would you cope with 25 Fib levels in ObjectCreate() ?

The index parameter tells ObjectSet()  what property of the object it is effecting/setting, for example:  colour, line width, line style, font, price1, time1, etc.
 
but how to draw arrows on graph..cant understand clearly from documentation..
 
ankit29030:
but how to draw arrows on graph..cant understand clearly from documentation..
You can usually understand Objects better if you first try to draw what you need manually, without mql4,  then look at the properties of what you have drawn . . .  so how do you drawn an Arrow manually ?
 
Use ObjectCreate() with type OBJ_ARROW  and specify the object name, the Window, time1 and price1.  Then you can use ObjectSet() to set the OBJPROP_ARROWCODE, then the OBJPROP_COLOR  etc.
 
whats the purpose of price2 and time2 ??
 
ankit29030:
whats the purpose of price2 and time2 ??

A Trend Line has a start,  Price1, Time1 and an end, Price2, Time2 . . .   other objects like a Horizontal Line or an Arrow have 1 set of coordinates, Price1, Time1  if you look at the documentation it tells you this . . .

 OBJ_ARROW   "OBJ_ARROW 22 Arrows. Uses 1 coordinate."

 
RaptorUK:

A Trend Line has a start,  Price1, Time1 and an end, Price2, Time2 . . .   other objects like a Horizontal Line or an Arrow have 1 set of coordinates, Price1, Time1  if you look at the documentation it tells you this . . .

 OBJ_ARROW   "OBJ_ARROW 22 Arrows. Uses 1 coordinate."


int start()
  {
  int limit;
  int counted_bars=IndicatorCounted();
  //---- check for possible errors
     if(counted_bars<0) return(-1);
  //---- the last counted bar will be recounted
     if(counted_bars>0) counted_bars--;
     limit=Bars-counted_bars;
  //---- main loop
     for(int i=0; i<limit; i++){
   ObjectCreate("any",OBJ_ARROW,0,Time[0],High[0]);
   ObjectSet("any",OBJPROP_ARROWCODE,SYMBOL_ARROWDOWN);
}

not working !!!!!!

want to draw arrows on each bar in daily frame... 

 
ankit29030:

not working !!!!!!

want to draw arrows on each bar in daily frame... 


Off course that's not working :D

To draw several objects, you have to set different name for each object. Your code there show that you trying to draw several object but each one of them have the same name. 

And also if you want to draw several objects on each bar, then why you set the same coordinate for each of the object ?

int start()
  {
  int limit;
  int counted_bars=IndicatorCounted();

  //---- check for possible errors
     if(counted_bars<0) return(-1);

  //---- the last counted bar will be recounted
     if(counted_bars>0) counted_bars--;
     limit=Bars-counted_bars;

  //---- main loop
     string name = "";
     for(int i=0; i<limit; i++)
        {
        name = "any "+ i;

        ObjectCreate(name,OBJ_ARROW,0,Time[i],High[i]);
        ObjectSet(name,OBJPROP_ARROWCODE,SYMBOL_ARROWDOWN);
        ObjectSet(name,OBJPROP_TIME1, Time[i]);
        ObjectSet(name,OBJPROP_PRICE1,High[i]);

        WindowRedraw();
        }

  return (0);
  }
 
whats the use of WindowRedraw();??
 
ankit29030:
whats the use of WindowRedraw();??
Read for yourself:  WindowRedraw()
Reason: