Function Placement

 

I am writing a simple custom indicator that is simply going to plot a line of the (high - close)/3. I have created the following:


double H=high

double L=low

double x= H-L/3


I have three questions:

1.) Where do I place the I have been placing the variable at the top and get an error message about global variables can not be used? Where do the variables go in relation to the buffer? before or after? How do I fix this?

2.) is the function "double x=H-L/3 placed in the int init(), int start() or deint()?

3.) I can't the the function to draw on the chart. Any help?


Thanks for your help to an easy problem.

 

1) after start

2) the same

3) c https://docs.mql4.com/objects

4) High[x] or iHigh(...) & not high Low[x] ................

 
qjol:

1) after start

2) the same

3) c https://docs.mql4.com/objects

4) High[x] or iHigh(...) & not high Low[x] ................


Thanks for your help. I am new to the programing and can not find a sample code of just a simple code to create a line on the graph strictly using OHLC data.


Thanks again.