//+------------------------------------------------------------------+ //| research 5 - chart 2 red lines ETI.mq4 | //| Copyright 2012, Evert | //| | //+------------------------------------------------------------------+ #property copyright "Copyright 2012, Evert" #property link "" int time1, time2, time3; bool ObjectCreate(string name, int type, int window, datetime time1, double price1, datetime time2=0,double price2=0, datetime time3=0, double price3=0) if(ObjectCreate(/* arguments */)==false) { // an error occurred, its code should be recorded into a journal Print("Error of calling ObjectCreate():",GetLastError()); } //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { //---- double price=iHigh(Symbol(),PERIOD_D1,0); // this useful function returns the maximal price for: // * specified security, in our case it is Symbol() - // active security // * specified period, in our case it is PERIOD_D1 (daily) // * specified bar, in our case it is 0, the last bar ObjectCreate("highLine",OBJ_HLINE,0,0,price); // let us view all parameters: // "highLine" - the unique object name // OBJ_HLINE - object type of the horizontal line // 0 - the object is drawn in the main window (chart window) // 0 - X coordinate (time), it shouldn't be indicated, because // we are drawing a horizontal line // price - Y coordinate (price). It is the maximal price price=iLow(Symbol(),PERIOD_D1,0); // the function is identical with iHigh in arguments, but it returns // the minimal price ObjectCreate("lowLine",OBJ_HLINE,0,0,price); //---- return(0); } //+------------------------------------------------------------------+