Forum

How to Get Price Coordinate of Horizontal Line?

Greetings, I am trying to figure out how to get the price of a horizontal line . E.g. my program is to iterate through all horizontal lines and collect their prices I.e. int obj_total=ObjectsTotal(); for(int i=0;iobj_total;i++){ if(ObjectType(name)==OBJ_HLINE){ //obtaining the price of the line

Indicator Buffer does Not Allocate Memory for All Indicators?

Greetings, I'm trying to create an envelop around an SMA, so altogether I have 3 indicators i.e. SMA itself, the upper band and the lower band. In my code, indicator buffers allocates memory for maximum allowable 8 indicators. However, only 2 first indicators (out of 3) show up on the chart. The

Result of substracting 2 non-equal doubles = 0

Hello there, I've got some weird math here. Somehow substracting a double from a double, which are never equal BTW, produces zero. Could please someone explain this phenomena? Below is the code and output. double sixtySMABuffer[]; double sixtySMALowerBandBuffer[]; int init() {

Output problem with Print() [broker dependent]

Hi, By some reason, Print() function doesn't output anything in the log in my newly installed Alpari. However, it used to perfectly work on FXDD. Any ideas why it is so? Sorry for a bunch of silly quesion, guys, - I am completelty new to MT programming

How to find out number of bars for timeframe which is not currently displayed on chart?

Greetings, I want to iterate through all bars of the timeframe which may not be current on the chart e.g. the current time frame is daily, and I'd like to iterate though hourly e.g. iTime (NULL, PERIOD_H1, i). How can I get the number of bars on the hourly chart? Using while(true) with break when

How to get current timeframe?

Greetings, Does anyone know if there is some function to get the current chart time frame? I realize that this info can be obtained by comparing times of 2 adjucent bars, but this approach is definitely more involved. Thank youin advance

How to pass variables to array?

Greetings, Does any one know how to pass variables to an array e.g. I am doing something like 1 for(i=Bars-j-1; i>=0; i=i-6){ 2 double highs[6] = {High[i], High[i+1], High[i+2], High[i+3], High[i+4], High[i+5]}; 3 int index = ArrayMaximum(highs); ..... } and getting a compilation error: 'High' -