Help with lines - page 3

 
LTR:

Hi RaptorUK can I ask if I wanted a horizontal line drawn at the highest price and the lowest price between the two time periods I tried code below as you guessed nothing happened I was expecting the lines to be drawn at the high and low not between the two times.

 Can you please point in the direction of where I will find how to draw Hlines on the High & Low points on a chart I have tried PRICE_HIGH and MODE_HIGH can I also add the two time scales after or before the PRICE_HIGH and PRICE_LOW

You need to find the bar numbers where the highest and lowest occured,  then you can drawn the lines at the High[x] and Low[y]  of these bars.  You need to use iHighest() and iLowest()  to get the bar numbers.
 
val=High[iHighest(NULL, 0,MODE_HIGH, TimeCurrent() - (TimeCurrent() % (PERIOD_H1 * 60)), TimeCurrent() - (TimeCurrent() % (PERIOD_H1 * 60)) + (7 * PERIOD_H1 * 60))];
would it be something like that then do I add val to ObjectCreate
 
LTR:
would it be something like that then do I add val to ObjectCreate

You are sort of on the right track, but iHighest() and iLowest() take ints for the int count=WHOLE_ARRAY, int start=0 parameters. So you will need to convert the datetimes for midnight and 7 am to bar numbers using iBarShift() . Declare some variables to hold these values so your code is easy to read and understand. Something like this . . .

int BarNumMidnight, BarNum7am;
datetime Midnight, Time7am;
double High0To7, Low0To7; 

Midnight = TimeCurrent() - (TimeCurrent()%(PERIOD_D1 * 60)); 
Time7am = TimeCurrent() - (TimeCurrent()%(PERIOD_D1* 60)) + (7 * PERIOD_H1 * 60);

BarNumMidnight = iBarShift(NULL, 0, Midnight);
BarNum7am =  iBarShift(NULL, 0, Time7am);


ObjectCreate("Line",OBJ_VLINE, 0, Midnight, 0);
ObjectCreate("Line1",OBJ_VLINE, 0, Time7am, 0);

High0To7 = High[iHighest(Null, 0, MODE_HIGH, BarNumMidnight - BarNum7am + 1, BarNum7am)];

Low0To7 = Low[iLowest(Null, 0, MODE_LOW, BarNumMidnight - BarNum7am + 1, BarNum7am)];

then use the values to create your horizontal lines . . . please don't use this code as is, I've not compiled or tested it, instead read it, understand it then do something similar of your own choosing.

 
Thanks RaptorUK for your help I have read it I thought I understood it have been through the documentation again and again objects list says I have two lines  but still can't see two horizontal lines for the highest and lowest will have another look tomorrow anyway thanks again for your help.
Reason: